It's not all rainbows and unicorns for cops in central California.

A pony dressed up as the mythical spiral-horned beast escaped from a photoshoot and evaded capture for four hours on Wednesday night.

At 5:30 p.m., Juliet bolted from a home in the Fresno suburb of Madera Ranchos just as owner Sandra Boos was taking pictures of her with a child.

Pony dressed up as unicorn leads CHP on chase in Madera County: https://t.co/BAcNgzXMFW pic.twitter.com/t6IQhJuf0K — ABC30 Fresno (@ABC30) February 26, 2016

Multiple drivers reported seeing the 400-pound animal, wearing a pink halter and horn, trotting into traffic on different highways.

California Highway Patrol officers scrambled a helicopter with an infrared camera, and located Juliet in an orchard. She reportedly shied away from officers when approached, but eventually followed a horse ridden by Boos' friend Renee Pardy into a pen.

"I was standing with the CHP at the time and a call came over the radio that said the unicorn is in custody, and there was a huge sigh of relief, a few tears and some laughter," Boos told KMPH News. "It was the comedic relief needed in the moment."

Another pic of #unicorn that escaped a birthday party and was caught by CHP: https://t.co/smCo8oruOT pic.twitter.com/z7nNMkHnbE — KTVU (@KTVU) February 26, 2016

A professional photographer, Boos regularly dresses Juliet as a unicorn for photo shoots with children. She told the New York Daily News that Juliet had also escaped earlier in the day from a children's party and was "a little sore from running five miles," but was otherwise fine.

CHP officer Joshua McConnell told Fox 2 it was fortunate there was a happy ending.

"No injures were reported but there were several near misses (by cars). The pony was just lucky. It was returned to it's owner unharmed and was secured," McConnell said. "But had the pony been hit by a car, it would have been a different story."

CORRECTION: An earlier version of this story incorrectly stated it was a heat-seeking radar that was used to track Juliet down.