When civil war erupted in Libya, two friends joined the battle to topple Moammar Gadhafi on opposite sides of the country. They met again this week in the dictator's sprawling Tripoli compound.
Loay al-Magri, 24, was home in the eastern city of Benghazi on break from his architecture studies in Egypt when the first protests of the anti-Gadhafi uprising broke out in mid-February.
Gadhafi's security forces opened fire on the Benghazi protesters, killing dozens, so the opposition too armed itself and took control of a large swath of Libya's east.
Loay was due to finish his last year before graduating this spring, but instead chose to stay at home.
"The revolution had started, so I had to drop the semester and stay in Libya to fight," he said.
Although he had never held a gun before, he joined an armed group in Libya's east and received basic military training.
In June, he and other fighters flew from Benghazi to Tunisia and crossed the border into Libya's western Nafusa mountains, where local rebels were gradually seizing villages, carving out another rebel enclave they would use to launch an offensive on Tripoli.
Meanwhile, his friend Murad, a 22-year-old engineering student, bought a used Kalashnikov rifle for almost $3,000 and rode by boat to fight in the rebel-held city of Misrata, east of Tripoli, were Gadhafi's forces launching daily barrages of mortar and rocket fire.
The regime also posted snipers on rooftops along the city's main commercial thoroughfare, Tripoli Street, turning much of the city's downtown into a death zone.
After weeks of vicious street battles and blocking access routes with shipping containers and burned-out cars, local rebels managed to turn the siege on the snipers, cutting their supply lines, then attacking their nests with rocket-propelled grenades, anti-aircraft guns and even flaming car tires.
In late April, rebels solidified their control over the city center and turned to battle the rocket squads on the city's outskirts.
Rebel progress was slow in the next few months, and it often appeared that the civil war had reached a stalemate. But in August, rebel fighters solidified their grip over the Nafusa mountain range and pushed north to the city of Zawiya on Libya's coast.
On Sunday, they pushed east toward Tripoli, entering the city after overrunning the base of an elite military unit headed by one of Gadhafi's sons just outside of town.
Loay had fought his way north with them from the mountains and rolled with them into Tripoli. The entry of the mountain fighters into the capital boosted rebel morale across the country, spurring advances on all fronts.
Hundreds of rebel fighters from Misrata, who had been bogged down for months, finally broke through and reached Tripoli, including a few hundred who sailed in by boat.
Murad's unit reached the city just in time to join the fight for Bab al-Aziziya. It was inside, while celebrating with friends, that he bumped into Loay. The two friends embraced, hardly able to believe they had met again hundreds of miles (kilometers) from home, inside a Gadhafi compound.
Both said fighting in the war has changed their lives, though they don't plan to carry guns in the post-Gadhafi Libya.
"I don't think I'll have to," Loay said. Once the war is over, he says, he'll finish his architecture degree and come home to help build the state.
Murad, who declined to give his full name because he hasn't told his parents where he is, says he'll return to university after the war, though he hasn't decided yet what he'll do next.
"The whole scene in Libya is changing, so we have to re-plan our future," he said. "So many more doors are open now."