Update: Randy Jones, 38, was arrested in connection with the shooting, police said on Tuesday. For the latest updates on the case, click here.

NEW YORK (PIX11) — Police took a suspect into custody on Monday in the Saturday shooting of an off-duty NYPD officer, sources said. 

The man, who’s in his 40s, was taken into custody by the Regional Fugitive Task Force after a widespread manhunt. The man was found at a hotel in Spring Valley.

The man went from a person of interest to a suspect after being questioned by police, authorities said.

The off-duty officer was shot in Brooklyn on Saturday, officials said. He was out trying to buy a vehicle he found on Facebook Marketplace.

The off-duty officer was in civilian clothing and was with his brother-in-law when he showed up with more than $20,000 in cash to purchase the SUV, sources told PIX11 News.

At some point during the exchange, the would-be vehicle seller drew a gun and opened fire, hitting the off-duty officer in the head, sources said. The officer’s brother-in-law managed to get the cop’s gun out of its holster and returned fire. The shooter ran off and sped away in a waiting SUV, without any of the officer’s cash.

The officer was critically injured in the shooting. He was still at the hospital, fighting for his life, on Monday. The officer, a five-year NYPD veteran, is assigned to the patrol division.

Peter Shankman, a social media and tech advisor, said the tragedy is a cautionary tale for online buyers and sellers.

“You have to limit your liabilities. Almost every single police precinct in the country will allow you now to pull up in front of their precinct to make a deal on Facebook Marketplace,” said Shankman.