Two men suspected of vandalizing a historic military structure at a national park north of San Francisco had to be rescued by authorities after they were stranded on a steep cliff while trying to escape Thursday, authorities said.

Park service spokeswoman Alexandra Picavet said the men got stuck on a cliff at the waterfront of Fort Baker in Golden Gate National Recreation Area.

Rangers confronted the men near Battery Yates, a historic military building along the water at Fort Baker, just north of the Golden Gate Bridge. When the men saw the rangers approaching, they tried to evade arrest by scrambling down a cliff near the water's edge, Picavet said.

Rangers, Southern Marin Fire Department officers, a CHP helicopter and a Coast Guard boat all helped rescue both men, she said.

A team reached the first man and used technical rope skills and climbing gear to get him to firm ground. The second man was lifted to safety by a long-line from the CHP helicopter, Picavet said.

Both are in custody and face vandalism-related charges.