Merkel's spokesman said the German chancellor, who is 65, was informed about the doctor's test shortly after holding a news conference Sunday announcing new measures to curb the spread of the virus.
Her spokesman, Steffen Seibert, said Merkel had received a precautionary vaccine Friday against pneumococcal infection.
For most people, the new coronavirus causes only mild or moderate symptoms, such as fever or coughing. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia. About 93,800 people have recovered, mostly in China.
Seibert said in a statement that Merkel would undergo "regular tests" in the coming days and continue with her work from home for the time being.
Merkel had earlier expressed her gratitude to Germans who were following the rules on social distancing, saying it was important to remain at least 1.5 meters (about five feet) apart to reduce the likelihood of infection.
The development illustrated how even world leaders aren't free from the risk of infection.
"With a certain distance the risk of infections is reduced almost to zero," Merkel told reporters. "Whether you are half a meter apart or 1.5 meters apart makes a huge difference."
Seconds later, she was informed that her doctor had tested positive for COVID-19.