A Colorado police dog turned out to be in the right place at exactly the right time last week, helping to locate a missing 12-year-old girl in Wyoming, according to officials.

The Jefferson County Sheriff's Office said on Facebook that Deputy K. Fosler and bloodhound Jessie were in Wyoming on an unrelated call when they were diverted for a request with the search of a missing girl.

Brianna Weinart was reported missing around 10 p.m. on Monday, according to the Casper Star-Tribune.

CONNECTICUT POLICE WRANGLE 6-FOOT SNAKE WRAPPED AROUND CAR ENGINE

The deputy and Jessie joined in the search for their girl, but the nearly 90-degree heat required the dog to take a 20-minute break in spite of wearing a cooling vest. The cactus-dense area also made search efforts more difficult, according to the sheriff’s office.

"For nearly two hours, she searched the Wyoming area where the 12-year-old girl was last seen......and then she pulled her handler, Deputy Fosler, back toward the direction they started. Deputy Fosler thought she had lost the scent," police said. "Turns out, she knew exactly where she was going and as the pair got closer to a home, Jessie went around to the back and near a large bush, they spotted the girl, hiding."

Weinart was hungry, dehydrated and sunburned after 20 hours, but was "otherwise uninjured," according to the sheriff's office.

OHIO COUPLE, AGES 100 AND 102, WED AFTER FALLING IN LOVE AT SENIOR HOME

Authorities told the Star-Tribune they don't suspect any criminal involvement in the girl's disappearance and said she does not have any medical issues.

CLICK HERE FOR THE FOX NEWS APP

"This is one of those stories we’re glad to share with the public because it goes to our core mission of Protect, Serve, Enforce," police said. "We’re thankful this young girl is going to be OK, and we’re thankful Deputy Fosler and K9 Jessie were in Wyoming and able to respond to help another agency and this family."