Reuters reports that the disease was confirmed in pigs on two farms in the eastern German state of Brandenburg.
Previous cases have only been found in wild animals, with 1,267 African swine fever cases so far in wild boar in the Brandenburg area. Brandenburg is on the border with Poland, where the disease is widespread.
China and other pork buyers banned imports of German pork in September 2020 after the first case was confirmed in wild animals. Import bans by China and major Asian importers remain in place.
Germany's Friedrich-Loeffler scientific institute had confirmed the farm animals had African swine fever, the agriculture ministry said.
The disease was found in pigs on one organic farm with 200 animals and on a smallholding with only two pigs, the Brandenburg health ministry said. All have been slaughtered.
"For almost a year we have been fighting against the enormous pressure of the disease from Poland," said Brandenburg state health minister Ursula Nonnemacher.
Fencing has been built along the Polish border to prevent wild boars entering Germany and six zones were established with intensified hunting of wild boars, she said.
"I very much regret the first cases in farm pigs, but sadly this possibility could never be fully ruled out," Nonnemacher said.
The import bans on German pork imposed last year have led to trade displacement, with EU producers including Spain raising exports to Asia while Germany increased sales inside the EU.
The agriculture ministry said the regionalisation concept means Germany’s pork exports inside the EU will continue.
The regionalisation concept means stopping pork imports from the region of a country where African swine fever has been found but not a blanket ban on sales from the whole country.