Tests on a number of ducks from the farm at Wachenroth near the southern city of Erlangen, 200 kilometres (120 miles) north of Munich, confirmed the strain, local authority spokeswoman Annika Fritzsche told AFP.
Investigations will continue to determine how the virus -- which in its highly pathogenic strain can also infect humans, sometimes fatally -- entered the farm, Fritzsche said.
It was detected in three young ducks from a batch delivered four weeks ago by a supplier in the northern German state of Lower Saxony, whose premises will also be inspected, a spokeswoman for the agriculture ministry in Berlin said.
H5N1 was found in other ducks in Bavaria this month and over the summer around 50 wild birds were found dead with the virus across the country.
Wild birds can infect domesticated birds with the highly pathogenic strain. Experts fear it will mutate into a strain that can be transmitted between humans.