New Yorkers were briefly transfixed Monday morning by the fate of two bearded commuters — a pair of bewildered goats — who found their way onto the tracks of the N line in Brooklyn.

In the end, none other than Jon Stewart swooped in to transport the strays to a shelter in upstate New York run by the Farm Sanctuary animal rescue organization.

The goat saga began at 8:23 a.m. ET when the MTA sent a tweet shortly after they were discovered near the Eighth Avenue stop in the Bay Ridge section of Brooklyn. That message was followed about an hour later by tweet with a picture showing two goats, a matching set with white fur bodies and black and brown heads.

Social media-connected New Yorkers responded with equal parts sympathy and sarcasm about the goats’ plight, even if it did create yet more delays for New York’s disruption-prone subway system.

Justin Brannan, New York City Councilman serving the district where the animals were discovered, made a crack at the MTA’s expense. “BREAKING: Wayward goats faster than N train.”

BREAKING: Wayward Goats Faster Than N Train pic.twitter.com/xXUJBp4q2S — Justin Brannan (@JustinBrannan) August 20, 2018

Some welcomed the new kids to the neighborhood.

Others demanded to know everything about their fate.

I NEED THE ORAL HISTORY OF THE GOATS ON THE SUBWAY TRACKS AND I NEED IT NOW!!! — sonia saraiya (@soniasaraiya) August 20, 2018

By 10 a.m., the goats had been tranquilized and removed from the tracks by the NYPD.

Later, Farm Sanctuary arranged to pick the animals up for transport to the sanctuary in Watkins Glen, N.Y., in the bucolic environs of the Finger Lakes. Stewart has been a longtime supporter of the animal rescue org and has been active with them since he stepped down as anchor of “The Daily Show” in 2015.

The sight of Stewart and another woman herding Billy and Willy (as they were christened, at least online) into a trailer for a ride to a good home was definitely today’s moment of zen.