A California man who was suspected of stalking a former girlfriend and violating a restraining order tried to evade police by hiding in a massive corn maze.

For around two hours, officers scoured the corn maze in search of 29-year-old Ryan Kenneth Watt.

Watt was eventually found inside a chicken coop on the property.

He is currently being held on $250,000 bail.

Visit Insider's homepage for more stories.

A California man tried to evade police by sprinting across a freeway and hiding — for two hours — in a massive corn maze before he was eventually caught.

Officers were looking for Ryan Kenneth Watt, a 29-year-old from Petaluma, in Sonoma County, who was suspected of stalking a former girlfriend and violating a restraining order that prohibited him from speaking to her, The Press Democrat reported.

When police approached him, Watt fled into the Petaluma Pumpkin Patch corn maze, one of the largest corn mazes in Northern California and a popular Halloween attraction as the holiday approaches.

"I've been to that maze myself, off duty with kids," Lt. Ed Crosby of the Petaluma Police Department told The Mercury News. "It's a great place to hide. It's very narrow. It takes a long time to get through it." The Petaluma Pumpkin Patch's website says there's only one way out of the maze.

Police told The Mercury News that they had documented five previous cases last month in which Watt stalked his former girlfriend, resulting in him being arrested on three occasions. That included him showing up at her home uninvited, going to her son's sports practices, and hacking her social media accounts to track where she was, police said.

The officers began looking for Watts after she told them he was sending her text messages and calling her to try and convince her to drop the charges against him.

The Petaluma Corn Maze in 2017. The Press Democrat

After running away, police scoured the corn maze in search of Watt. They requested maps, set up a perimeter around the maze (which sits on 4 acres and takes at least 45 minutes to find your way out), and, in groups of two or three, wandered around with guns drawn. A California Highway Patrol helicopter flew above the maze to spot Watts from the sky.

But after around two hours, Crosby said they began to lose hope: The helicopter was almost out of fuel and officers were feeling dejected.

"At some point, you have to call it," he told The Press Democrat.

That's when an officer noticed a nearby chicken coop outside of the maze, and decided to take a look inside.

"And there he was," Crosby told The Mercury News. "We think he hunkered down in the maze and then ran out into the coop."

Watts was promptly arrested and jailed on suspicion of violating his restraining order and resisting arrest, among other charges, Crosby told The Press Democrat. He is currently being held on a $250,000 bail.