Loekke Rasmussen, who led the country until June, tweeted Thursday to Trump: "We have had (proportionally) exactly the same numbers of casualties in Afghanistan as US. We always stands firm and ready."
Trump, who has urged NATO members to do more to meet the alliance's goal of committing 2 percent of gross domestic product to defense, earlier tweeted that "Denmark is only at 1.35%."
"We will not accept that our defense willingness is only about percentages," Loekke Rasmussen tweeted. "I told you at the NATO Summit in Brussels last year."
Trump abruptly canceled his planned Sept. 2-3 visit to Denmark on Tuesday, after Frederiksen had called Trump's idea to buy Greenland "an absurd discussion."
Trump said her comment "was nasty. I thought it was an inappropriate statement. All she had to say was say, 'No, we wouldn't be interested.'"
Frederiksen said the U.S. remains one of Denmark's close allies.
The political brouhaha over the world's largest island comes from its strategic location in the Arctic. Global warming is making Greenland more accessible to potential oil and mineral resources. Russia, China, the U.S., Canada and other countries are racing to stake as strong a claim as they can to Arctic lands, hoping they will yield future riches.
Frederiksen has said that Denmark doesn't own Greenland, which belongs to its people. It is part of the Danish realm along with the Faeroe Islands, another semi-autonomous territory, and has its own government and parliament, the 31-seat Inatsisartut.
The sparsely populated island, which is four times zones behind Copenhagen, became a Danish colony in 1775 and remained that way until 1953, when Denmark revised its constitution and made the island a province.
In 1979, Greenland and its 56,000 residents, who are mainly indigenous Inuits, got extensive home rule but Denmark still handles its foreign and defense policies, as well as currency issues.
Denmark pays annual subsidies of 4.5 billion kroner ($670 million) to Greenland whose economy otherwise depends on fisheries and related industries.
On Wednesday, the U.S. State Department said Secretary of State Mike Pompeo spoke with his Danish counterpart and "expressed appreciation for Denmark's cooperation as one of the United States' allies and Denmark's contributions to address shared global security priorities."
Spokesperson Morgan Ortagus said Pompeo and Danish Minister of Foreign Affairs Jeppe Kofod "also discussed strengthening cooperation with the Kingdom of Denmark — including Greenland — in the Arctic."
"Appreciate frank, friendly and constructive talk with @SecPompeo this evening, affirming strong US-DK bond," Kofod tweeted Wednesday evening. "U.S. & Denmark are close friends and allies with long history of active engagement across globe."
Follow the AP's full coverage of Greenland at https://apnews.com/Greenland