Updated

The White House on Monday said randomized COVID-19 testing, which was once voluntary, would be mandatory for staff to "protect the health and safety" of all officials, Fox News has learned.

"As part of our ongoing efforts to protect the health and safety of the entire White House Complex, randomized testing of Executive Office of the President staff, which has been ongoing for several months, will now become mandatory rather than voluntary," a White House senior official told Fox News Monday.

NATIONAL SECURITY ADVISER TESTS POSITIVE FOR COVID-19

The move comes after White House National Security Adviser Robert O'Brien tested positive for COVID-19, becoming the highest-ranking administration member to contract the virus.

An administration official told Fox News last week that O'Brien contracted the virus outside of the White House, and had recently traveled to France to meet with President Emmanuel Macron and was also at a family gathering.

O'Brien's diagnosis came days after a cafeteria and another eatery on White House grounds were shut down due to a worker testing positive for COVID-19. Those locations were in the Eisenhower Executive Office Building, which is home to the National Security Council, although according to the General Services Administration (which oversees the Eisenhower building), the White House Medical Unit was conducting contact tracing and determined that the chance of retransmission of the virus was very low.

O'Brien is not the first member of the administration to contract the illness. In May, Vice President Mike Pence's press secretary Katie Miller tested positive, months after another Pence staffer became the first White House employee known to test positive.

In June, two Secret Service members tested positive following a Trump campaign event in Tulsa, Okla. As a result, other Secret Service officers who had been present for the event were told to stay home and quarantine for 14 days.

TRUMP VALET TESTS POSITIVE FOR COVID-19

And in May, a member of the U.S. military who worked on the White House grounds as one of President Trump's valets tested positive for coronavirus.

The White House has said that President Trump and Vice President Pence are tested regularly for the novel coronavirus.

Fox News' Mark Meredith, Kristin Fisher and John Roberts contributed to this report.