President Biden joked Wednesday that he's been told he must wear a mask after First Lady Jill Biden tested positive for COVID-19.

Biden made the joke while taking the stage during an event in the East Room of the White House, when he walked out holding a mask in his hand rather than wearing it in accordance with the precautions his staff said he would be taking.

"Hello everybody. Let me explain to the press, I've been tested again today. I'm clear across the board. But they keep telling me, because this has to be 10 days or something, I've got to keep wearing it. But don't tell them I didn't have it on when I just walked in," Biden said with a smile as attendees of the event laughed.

BIDEN'S RETURN TO INDOOR MASKING DRAWS SCORN ONLINE: ‘SUCH NONSENSE FEARMONGERING’

President Biden and First Lady Jill Biden

President Biden and first lady Jill Biden depart the White House on Saturday, Sept. 2, 2023. (Julia Nikhinson/For The Washington Post via Getty Images)

The first lady tested positive for COVID-19 on Monday — the second time she has contracted the virus — despite being double-vaccinated and having received multiple booster shots.

Following the diagnosis, White House press secretary Karine Jean-Pierre updated the press room on precautions that the president will be taking for the foreseeable future, including that he would "be masking while indoors and around people in alignment with CDC guidance."

She added: "As has been the practice in the past, the president will remove his mask when sufficiently distant from others indoors and while outside as well."

President Joe Biden

President Joe Biden speaks during an event in the State Dining Room of the White House in Washington, DC, US, on Wednesday, Sept. 6, 2023. (Bonnie Cash/UPI/Bloomberg via Getty Images)

However, Biden violated those guidelines later Tuesday evening when he removed his mask to deliver remarks at the Medal of Honor ceremony for retired Army Capt. Larry Taylor in the White House East Room — and never put it back on.

Jean-Pierre deflected when pressed by reporters about the violation on Wednesday, acknowledging Biden did not have his mask on and explaining he left the ceremony early to limit his contact with those in attendance.

CLICK HERE TO GET THE FOX NEWS APP

Fox News' Greg Wehner, Chris Pandolfo and Lindsay Kornick contributed to this report.