WASHINGTON — Two of the US hikers imprisoned in Iran on suspicion of being spies after straying across the border in July 2009 married in California, a lawyer and friend of the couple said Monday.

Shane Bauer and Sarah Shourd -- who became engaged during their time in captivity -- married Saturday at a ceremony in California with some 200 friends, family and supporters from around the world who rallied to their cause during imprisonment.

Bauer, Shourd and Josh Fattal were arrested near Iran's mountainous border with Iraq on July 31, 2009. All three maintained they were innocent of spying and had simply strayed across the border into the Islamic republic.

Iran released Shourd, a teacher, writer and women's rights activist, after 14 months in captivity on humanitarian grounds, but held Fattal and Bauer until September last year.

The ceremony was at an undisclosed location "in a rustic setting in the hills of California near the ocean," said Ben Rosenfeld, a San Francisco attorney who is Shourd's lawyer and a friend of the couple.

"Now that this day has come, all I can do is close my eyes and fill with gratitude, for our freedom, for the love of so many generous people around the world, and for the very soil under my feet," Shourd said in a statement before the wedding.

"I want the same freedom for everyone held unjustly and under barbaric conditions, in Iran and throughout the world," she said.

Bauer, a fluent Arabic-speaking freelance journalist, gave Shourd a ring from the threads of his shirt when he proposed to her in prison.

Bauer said that becoming engaged to Shourd while in captivity allowed him "to dream of a future that was not only secure, but also beautiful.

"After she was released, I often thought of her as a hero, fighting tirelessly for Josh and I. Our wedding is also a victory," he said.

Fattal was Bauer's best man at the wedding.

"The day Shane proposed to Sarah in prison gave us all hope for the future," Fattal said. "Shane and Sarah are my best friends. Our bonds are unbreakable."

The arrests angered Washington, which has deep differences with Tehran over its controversial nuclear program and its support for militant groups in the Middle East.