WARSAW, Poland — Seven decades after their deaths, a state burial was held Sunday in Poland for two World War II heroes who fought the Germans but were later killed by the communists for their pro-independence activity.

The relatives of the 17-year-old Home Army nurse and a 42-year-old ensign attended the religious ceremonies along with President Andrzej Duda and Polish government officials.

The burial with military honors took place in Gdansk, in the north, where the two were captured in 1946, tortured and executed on Aug. 28, 1946. Their bodies were dumped in an unmarked pit at Gdansk military cemetery. Pavement tiles were put on top to conceal the site.

The remains of Danuta Siedzikowna, codename “Inka,” and Feliks Selmanowicz, “Zagonczyk,” were found in 2014. They were identified through DNA tests as part of government efforts to locate and properly honor thousands of Poles who fought for the nation’s independence against the Nazi Germans and then against the communists.

Only a few hundred have been found so far across Poland. They were erased from history books for decades under communism.

“Against the plans of the communists and traitors, Poland will not forget you,” Duda said to applause during the funeral Mass. “What you did was right. Glory to the heroes.”

Hundreds of people turned out for the ceremonies at St. Mary’s Basilica and at the cemetery.

Siedzikowna’s story is particularly telling and painful. Her father, Waclaw Siedzik, was among the thousands of Poles deported by Soviet secret security to Siberia in 1940 and died three years later. Her mother, Eugenia Siedzik, was executed by the Germans in 1943 for her resistance activity. “Inka” joined the Home Army after her death and trained to be a nurse. After the war, she was active in fighting against the communist authorities that were imposed on Poland.

Historians say that, according to witnesses, her last words before her execution were “Long live Poland.”