Former President Donald J. Trump and his wife Melania were tacitly given coronavirus vaccinations in January before leaving the White House, an adviser said Monday.

The news came a day after Mr Trump appeared at the CPAC political conference in Orlando, Florida, where he first encouraged people to get vaccinated.

“Everyone should go to get your shot,” said Mr. Trump during the speech. When The Times asked an adviser to the former president if he had received his, the answer was that he had one privately a month earlier.

Mr Trump’s secret approach came when some of his supporters expressed opposition to the vaccine and other officials tried to set an example by making the shot public.

President Biden, Vice President Kamala Harris, and former Vice President Mike Pence received vaccination shots on television cameras.

Mr. Trump’s concern about the vaccine has generally been whether as president he will get credit for his development. He never publicly encouraged people to take it while in office; The first vaccines were approved shortly after election day.

The adviser did not say whether Mr Trump had received both his first and second vaccinations in January or whether the second came at a different time.

Mr and Mrs Trump were both infected with the coronavirus in the fall, and the former president was hospitalized with a serious case.