Dr. Matt Willis, Marin County’s top public health official, has tested positive for the coronavirus, he announced Monday as the number of confirmed cases in the county rose to 47.

Willis, the county’s public health officer, issued a “shelter in place” order last week aimed at stemming the spread of the COVID-19.

“On Friday I started feeling feverish with a worsening cough,” Willis, 54, said in a video announcement recorded at his home in San Anselmo.

County health workers tested Willis for COVID-19 on Friday. He learned of his diagnosis on Sunday and is isolating at home. Willis said his symptoms improved over the weekend, and he no longer has a fever.

“I don’t know where I was exposed,” Willis said. He noted that he attended a press conference in San Jose on March 16, where he joined public health officials from several Bay Area counties in announcing shelter-in-place orders across much of the region. The coronavirus outbreak in Santa Clara County is more widespread than in Marin, Willis said, and he began experiencing symptoms a few days after that conference, suggesting he may have become infected there.

“Or it may be related to the work we’re doing every day with people on the front lines, our health care workers and emergency responders who are regularly exposed as they treat patients from our community,” he said.

Willis has acted as the county spokesman for the coronavirus pandemic. Beginning in early March, he warned that community spread of COVID-19 in Marin was imminent. The first confirmed case in a Marin County resident was reported March 9, and by Monday, 47 residents had tested positive.

“It’s a clear sign of what we’ve been saying all along,” Willis said in his announcement. “I didn’t necessarily think I would be such an early example of the fact that this is in our community.”

Willis’s stay-at-home mandate, which went into effect March 17, was the first criminally enforceable order he has issued as the county’s public health officer, a role he has held since 2012. It places sweeping restrictions on business operations and limits the ability for residents to leave their homes for three weeks.

“We all need to take this seriously,” Willis said.

On Sunday, county health officials bolstered Willis’s mandate by shutting down all Marin parks to motor vehicles. Though the shelter-in-place order allows residents to go outside for exercise if they stay at least 6 feet away from people they do not live with, officials said parks were swarmed with visitors who were not following distancing requirements, creating opportunities for the virus to spread.

Residents can still use parks and trails if they access them by walking or biking from home, officials said.

“While my symptoms are now milder, as most people’s will be, we also know that for many, especially our elders, the same illness can be life-threatening,” Willis said. “That’s why it’s so important for us to take special care not to expose our older and other vulnerable residents.”

About 61% of Marin residents who have tested positive for COVID-19 at the county’s drive-thru testing site are between 35 and 64 years old. About 26% are 65 or older and 13% are between 19 and 34 years old. Nobody 18 or younger has been diagnosed with the illness.