The pro-Beijing lawmaker stood a row behind Xi, handout photos of the day showed.
Ho said he tested mildly positive on Friday and needed to be tested again. He did not attend any of the handover anniversary celebrations that day, according to a statement on his official Facebook page. He then tested positive for the virus on Sunday.
The fact that someone who came into contact with Xi tested positive for the virus is seen as a blow to the Hong Kong government, which has spent considerable time and resources preparing for the visit and trying to ensure that he remains Covid-free.
The border between Hong Kong and mainland China remains largely closed because of the virus.
Before his visit, hundreds of Hong Kong officials and lawmakers were forced into a “closed system” to prevent the virus from spreading. They were only allowed to drive between home and work in private vehicles and had to spend a night in a quarantine hotel on the eve of the handover anniversary. They were also subjected to daily tests.
Xi, who has not traveled outside mainland China since the pandemic began more than two years ago, spent Thursday and Friday in Hong Kong. He attended the anniversary events and swearing-in ceremony for Hong Kong’s new Beijing-appointed leader, former security chief and police officer John Lee.
Xi himself has imposed a strict “zero-Covid” policy on China, with state media frequently reporting that he “personally ordered and made arrangements” for the country’s fight against the pandemic.
Despite high vaccination rates and a reduction in the overall number of cases, the Hong Kong government remains committed to its own “zero-Covid”-style policy, maintaining strict social distancing and contact-tracing measures and strict border restrictions – including a mandatory seven-day hotel quarantine for all arrivals.
CNN’s Jessie Yeung and Kathleen Magramo contributed coverage.