Officers with the NYPD’s 103rd Precinct got someone’s goat on Tuesday evening — and promptly returned it to its owner.

The officers were flagged down in St. Albans, Queens, at about 5 p.m. after passers-by spotted a goat weaving between cars near 178th Street and 110th Avenue, a police spokeswoman said.

Officers corralled the goat and, despite a near-miss with a car, the goat was returned to its owner uninjured.

The spokeswoman said the goat’s owner was not identified. It was unclear how the goat got loose.

The responding officers did stop to take a few pictures with the animal, however.

Commanding officer Deputy Insp. John Cappelmann posted the photos on Twitter on Wednesday morning, writing: “Sometimes you get guns, sometimes you get goats! It’s not just a job, it’s an adventure.”

Loose animals aren’t unheard of on city streets. Another goat was captured after running loose in a Brooklyn hospital parking lot in 2013, according to media reports.

advertisement | advertise on newsday

Other animals found on city streets that have escaped from homes, petting zoos and slaughterhouses include hybrid wolf-dogs, zebras, alligators and a kinkajou.