Two hikers from Massachusetts spent an unexpected night in the woods after becoming separated from their party during a trek in Grafton Notch on Sunday.

Mary Burnham, 28, of Jamaica Plain, and Seamus Langan, 31, of Quincy, were found Monday afternoon after a 14-hour search of the rugged, mountainous area, according to a news release from Maine Warden Service Cpl. John MacDonald.

According to MacDonald, Burnham and Langan were hiking the Speck Pond trail east to Old Speck Mountain with four other people, and became lost after summiting the 4,180-foot peak, according to MacDonald. Instead of taking the trail to return to the trailhead on Route 26, the two inadvertently took the Mahoosuc Notch Loop trail south, in the opposite direction, and became lost.

The other members of the party realized Burnham and Langan were missing around 8 p.m. when they failed to show up at a prearranged meeting area at the Grafton Notch trailhead, MacDonald said.

Searchers started deploying in the area around 4 a.m. Monday. Teams made radio contact with the missing hikers around 11 a.m. with the aid of Warden Service aircraft, MacDonald said. Burnham and Langan were carrying a handheld radio that made communication possible and “aided greatly” in finding the missing hikers, he added.

Searchers from the Warden Service as well as Mahoosuc Search and Rescue and volunteer hikers found the missing pair around 1 p.m. Monday. Both were in good condition, despite their unexpected night in the woods, MacDonald said.