The identification was made after a previously attached tracker was recovered from the animal, according to the Environment Ministry of the German state of Mecklenburg-Vorpommern and Danish environmental officials.
The finding resolves earlier uncertainty over whether the carcass discovered off the Danish coast late this week was the same animal that had captivated Germany and made headlines worldwide.
The whale was first spotted off the German coast on March 3.
It is not clear why it swam into the Baltic Sea, which is far from its habitat and it was not suited to, although some experts said it may have lost its way while swimming after a shoal of herring or during migration.
In late March, it was rescued from shallow water in the German Baltic resort town of Timmendorfer Strand with the help of an excavator but it soon ran into trouble again nearby.
Local media produced days-long livestreams, and news sites alerted readers to the smallest developments in the whale's situation.
The stranded male whale was transported by barge to the North Sea and released on May 2.
Divers from Denmark's Nature Agency and a German veterinarian, who was part of the private initiative that had earlier transported the whale, had examined the whale on Saturday, at times diving beneath the carcass.
That inspection brought clarity after authorities had initially said on Friday that no transmitter had been found on the animal.
Morten Abildstrøm of Denmark's Nature Agency later explained that a tracker attached to the dorsal fin could not have been detected at first because the whale had been lying on its side and was later found on its back.
Authorities have yet to decide what will be done with the dead whale.
Jane Hansen, head of division at the Danish Environmental Protection Agency, said "at this time, there are no concrete plans to remove the whale from the area or to perform a necropsy, and it is not currently considered to pose a problem in the area".
But she said that it is important to stay away from it because of the possibility it may carry diseases.
with AP