Inas Fathy’s transformation into a secret agent for the rebels began weeks before the first shots were fired in the Libyan uprising that erupted in February 2011. Inspired by the revolution in neighboring Tunisia, she clandestinely distributed anti-Qaddafi leaflets in Souq al-Juma, a working-class neighborhood of Tripoli. Then her resistance to the regime escalated. “I wanted to see that dog, Qaddafi, go down in defeat.”

Related Content The Struggle Within Islam

A 26-year-old freelance computer engineer, Fathy took heart from the missiles that fell almost daily on Col. Muammar el-Qaddafi’s strongholds in Tripoli beginning March 19. Army barracks, TV stations, communications towers and Qaddafi’s residential compound were pulverized by NATO bombs. Her house soon became a collection point for the Libyan version of meals-ready-to-eat, cooked by neighborhood women for fighters in both the western mountains and the city of Misrata. Kitchens across the neighborhood were requisitioned to prepare a nutritious provision, made from barley flour and vegetables, that could withstand high temperatures without spoiling. “You just add water and oil and eat it,” Fathy told me. “We made about 6,000 pounds of it.”

Fathy’s house, located atop a hill, was surrounded by public buildings that Qaddafi’s forces often used. She took photographs from her roof and persuaded a friend who worked for an information-technology company to provide detailed maps of the area; on those maps, Fathy indicated buildings where she had observed concentrations of military vehicles, weapons depots and troops. She dispatched the maps by courier to rebels based in Tunisia.

On a sultry July evening, the first night of Ramadan, Qaddafi’s security forces came for her. They had been watching her, it turned out, for months. “This is the one who was on the roof,” one of them said, before dragging her into a car. The abductors shoved her into a dingy basement at the home of a military intelligence officer, where they scrolled through the numbers and messages on her cellphone. Her tormentors slapped and punched her, and threatened to rape her. “How many rats are working with you?” demanded the boss, who, like Fathy, was a member of the Warfalla tribe, Libya’s largest. He seemed to regard the fact that she was working against Qaddafi as a personal affront.

The men then pulled out a tape recorder and played back her voice. “They had recorded one of my calls, when I was telling a friend that Seif al-Islam [one of Qaddafi’s sons] was in the neighborhood,” recalls Fathy. “They had eavesdropped, and now they made me listen to it.” One of them handed her a bowl of gruel. “This,” he informed her, “will be your last meal.”

The bloody eight-month campaign to overthrow Qaddafi was predominantly a men’s war. But there was a vital second front, one dominated by Libya’s women. Denied a role as combatants, women did everything but fight—and in a few instances, they even did that. They raised money for munitions and smuggled bullets past checkpoints. They tended injured fighters in makeshift hospitals. They spied on government troops and relayed their movements by code to the rebels. “The war could not have been won without women’s support,” Fatima Ghandour, a radio talk-show host, told me as we sat in the bare-bones studio of Radio Libya, one of dozens of independent media outlets that have arisen since Qaddafi’s downfall.

Ironically, it was Qaddafi who first implanted a martial spirit in Libyan women. The dictator surrounded himself with a retinue of female bodyguards and, in 1978, ordered girls 15 years and older to undergo military training. Qaddafi dispatched male instructors to female-only high schools to teach young women how to drill, shoot and assemble weapons. The edict resulted in a major change in a highly traditional society in which schools were sex-segregated and in which the only option for women who aspired to a profession had been to enroll at a single-sex teaching college.

The mandated military training “broke the taboo [against mixing sexes],” says Amel Jerary, a Libyan who attended college in the United States and serves as the spokeswoman for the National Transitional Council, the government body that will rule Libya until elections for a Parliament are scheduled to take place in mid-2012. “Girls were suddenly allowed to go to university. There were male instructors anyway in high school, so [parents figured], ‘Why not?’” Since then, Libyan gender roles have become less stratified, and women enjoy greater rights, at least on paper, than many of their counterparts in the Muslim world. Divorced women often retain custody of their children and ownership of their home, car and other assets; women have freedom to travel alone, and they dominate enrollment in medical and law schools.

Even so, until the war broke out, women generally were forced to keep a low profile. Married women who pursued careers were frowned upon. And Qaddafi’s own predatory nature kept the ambitions of some in check. Amel Jerary had aspired to a political career during the Qaddafi years. But the risks, she says, were too great. “I just could not get involved in the government, because of the sexual corruption. The higher up you got, the more exposed you were to [Qaddafi], and the greater the fear.” According to Asma Gargoum, who worked as director of foreign sales for a ceramic tile company near Misrata before the war, “If Qaddafi and his people saw a woman he liked, they might kidnap her, so we tried to stay in the shadows.”

Now, having been denied a political voice in Libya’s conservative, male-dominated society, the female veterans are determined to leverage their wartime activism and sacrifices into greater clout. They’re forming private aid agencies, agitating for a role in the country’s nascent political system and voicing demands in the newly liberated press. “Women want what is due to them,” says Radio Libya’s Ghandour.

I met Fathy in the lobby of the seafront Radisson Blu Hotel in Tripoli one month after the end of the war. The usual crowd of do-gooders and mercenaries bustled around us: a team of French medical workers wearing stylishly coordinated tracksuits; burly former British soldiers now employed as security “consultants” to Western businessmen and journalists; former Libyan rebels in mismatched uniforms, still euphoric about the news that Qaddafi’s second-oldest son and one-time heir apparent, Seif al-Islam Qaddafi, had just been captured in the southern desert.

Like many women in this traditional Arab society, Fathy, round-faced and soft-spoken, was not comfortable meeting a male reporter on her own. She showed up with a chaperon, who identified himself as a co-worker at the new NGO, or nongovernmental organization, she had founded to assist former prisoners of the Qaddafi regime. Fathy eyed him for reassurance as she recounted her story.

She isn’t certain who betrayed her; she suspects one of her couriers. In mid-August, after 20 days locked in the basement, with rebel forces advancing on Tripoli from both the east and the west, she was moved to Abu Salim prison, notorious as the site where, according to Human Rights Watch, Qaddafi’s troops had massacred nearly 1,300 prisoners in 1996. The place was now filled to capacity with regime opponents, including another young woman in the next cell. As rumors flew among the prisoners that Qaddafi had fled Tripoli, Fathy prepared to die. “I was really thinking it was the end,” she says. “I had given away so much information to the fighters, so I thought that before they left they would rape and kill me. Some of the guards told me that they would do that.”

Meanwhile, though, she was unaware that Tripoli was falling. The guards vanished, and a few hours passed. Then a group of rebel fighters appeared, opened the jail and set the inmates free. She walked home to a joyous welcome from her family. “They were convinced that I would never come back,” she says.

I met Dalla Abbazi on a warm afternoon in the Tripoli neighborhood of Sidi Khalifa, a warren of mosques and concrete bungalows a stone’s throw from Qaddafi’s now-demolished residential compound. The final battle for Tripoli had raged up and down her block; many of the houses were pocked with bullet holes and scarred by blasts from rocket-propelled grenades. Standing in the tiny front courtyard of her three-story pink stucco house, with a flag of the new Libya hanging from the second floor, Abbazi—a strong-looking woman of 43 wearing a multicolored hijab, or headscarf—said she had nursed a quiet antipathy toward the regime for years.

“From the beginning, I hated [Qaddafi],” she says. In 2001, her three older brothers fell afoul of Qaddafi after a questionable call in a national soccer game—the sport was controlled by the Qaddafi family—led to an eruption of street protests against the regime. Charged with insulting the dictator, the men were sentenced to two years in Abu Salim prison. Their parents died during the sons’ incarceration; after their release, they were shunned by potential employers, Abbazi told me, and lived on handouts from relatives.

Then, on February 20 in Benghazi, protesters overwhelmed government forces and seized control of the eastern Libyan city. In Tripoli, “I said to my brothers, ‘We must be in this uprising, in the center of it,’” recalls Abbazi, who is unmarried and presides over a household that includes her younger siblings—five brothers and several sisters. Tripoli, the seat of Qaddafi’s power, remained under tight control, but its residents engaged in increasingly brazen acts of defiance. In March, Abbazi’s eldest brother, Yusuf, climbed into the minaret of a neighborhood mosque and proclaimed over the loudspeaker: “Qaddafi is the enemy of God.” Abbazi sewed liberation flags and distributed them around the neighborhood, then stored weapons for another brother, Salim. “I told him, they will never expect to find guns at the home of a woman,” she said.

On the night of March 20, NATO bombs fell on Tripoli, destroying air defense installations: Abbazi stood in the street, ululating and chanting anti-Qaddafi slogans. Tipped off by a neighborhood informant, military intelligence came looking for her. They appeared at her house after midnight. “I began screaming at them and biting the arm of one of the brigade members. They tried to get into the house, but I blocked them and fought them off. I knew that all of the guns were there and the flags.” As Abbazi told me the story, she showed me the marks on the wooden door left by a soldier’s rifle butt. The troops fired in the air, drawing neighbors into the street, and then, inexplicably, abandoned their effort to arrest her.

Not far from Abbazi’s home, in the Tajura quarter of Tripoli, Fatima Bredan, 37, also watched with exhilaration as revolution engulfed the country. I had learned of Bredan from Libyan acquaintances and was told she was working as a part-time volunteer at the Maitiga Hospital, a single-story compound set on a former army base. The hospital and adjacent airport and army barracks had been the scene of fighting during the battle for Tripoli. Now there was a heavy presence of former rebels here; some were guarding Qaddafi’s former ambassador to the United Nations, who had been badly beaten in one of many alleged revenge attacks against members of the deposed regime.

Sitting on a cot in a bare, sunlit hospital room, Bredan, a statuesque, dark-eyed woman wearing a brown hijab and a traditional gown known as an abaya, told me that she had seen her ambitions destroyed by the dictatorship years earlier. As a teenager, she never hid her contempt for Qaddafi or his Green Book, a turgid ideological tract published during the 1970s. The Green Book was compulsory reading for schoolchildren; extracts were broadcast every day on television and radio. Bredan perceived the document—which advocated abolition of private property and the imposition of “democratic rule” by “popular committees”—as fatuous and incomprehensible. When she was 16, she informed her politics teacher, “It’s all lies.” The instructor, a die-hard Qaddafi supporter, accused her of treason. “We have to get rid of this kind of person,” he told her classmates in front of her.

Bredan, an excellent student, dreamed of becoming a surgeon. But the teacher denounced her to Libya’s revolutionary committee, which informed her that the only place she could go to medical school was Misrata, 112 miles down the coast from Tripoli. For Bredan, that was unthinkable: Libya’s strict social codes make it difficult, if not impossible, for an unmarried woman to live alone. “I was very disappointed,” she recalls. “I fell into a depression.” Bredan married young, had a daughter, opened a beauty salon, taught Arabic and continued to imagine what her life could have been if she had been allowed to become a doctor. Most of all, she yearned to work in a hospital, to help the sick and dying. Then the war broke out.

Misrata was the hardest-hit city during the Libyan civil war. I went there at the invitation of the al-Hayat, or Life, Organization, a newly formed women’s charity whose members I had encountered while touring Qaddafi’s destroyed compound in Tripoli two days earlier. Arriving in Misrata in the late afternoon, I drove past the ruins of Tripoli Street, the former front line, and found my way to the city’s two decent hotels, both of which, it turned out, were fully occupied by Western aid workers. The only alternative was the Koz al Teek Hotel, a battle-scarred hulk where rebels had fought a fierce battle with Qaddafi’s troops. Inside a bullet-torn lobby with a burned and blackened ceiling, I met Attia Mohammed Shukri, a biomedical engineer-turned-fighter; he worked part time for al-Hayat and had agreed to introduce me to one of Misrata’s female heroes.

Shukri had taken part in the battle of Misrata, which withstood a siege that some have compared to the Battle of Stalingrad. “You just cannot imagine how terrible it was,” he told me. In February, government forces surrounded Misrata with tanks, sealing off the entrances and pummeling the city of 400,000 for three months with mortars, Grad rockets and heavy machine guns; food and water ran short. The rebels had shipped weapons in by sea from Benghazi and, with the help of precision NATO bombing on Qaddafi positions, retook the city in June. In a dimly lit classroom, I first met 30-year-old Asma Gargoum. Slight and energetic, she spoke fluent English.

On February 20, the day violent clashes erupted in Misrata between government forces and demonstrators, Gargoum told me, she had driven back from her job at the tile factory, two miles from Misrata, and gone out to get groceries when she was stopped by the police. “Go back to your house,” they warned her. She hurried home, logged onto Facebook and Twitter, and prepared for the worst. “I was afraid,” she told me. “I knew how much Qaddafi armed himself, what he could do to people.”

As government forces rained down mortars on the city center, Gargoum’s three brothers joined the civilian army; Gargoum, too, found a useful role. During the lull that usually lasted from 6 to 9 each morning, when the exhausted fighters went home to eat and sleep, Gargoum crept up to the rooftop of her house overlooking ruined Tripoli Street—the center of the standoff between rebels and government forces—and scanned the city, pinpointing troop movements. She spent hours on her computer every morning, chatting with friends and former classmates across Misrata. “What did you see on this street? What’s moving? What’s suspicious?” she would ask. She then sent messages via courier to her brothers—Qaddafi’s intelligence operatives were monitoring all cellphones—informing them, for instance, about a white car that had cruised six times slowly around her block, then disappeared; a minibus with blackened windows that had entered the gates of the medical university, possibly now an army barracks.

Sometimes she posed online as a Qaddafi supporter, to elicit responses from friends who likely opposed the rebels. “Twenty tanks are coming down Tripoli Street, and they will enter Misrata from the east side, they will kill all the rats,” one former classmate told her. In this way, Gargoum says, “We were able to direct [rebel] troops to the exact street where the government troops were concentrating.”

The war exacted a heavy toll on those close to her: Gargoum’s best friend was shot dead by a sniper; the heavily damaged minaret of a next-door mosque toppled onto the family house on March 19, destroying the top floor. On April 20, a mortar scored a direct hit on a pickup truck carrying her 23-year-old brother and six other rebels on Tripoli Street. All were killed instantly. (The war photographers Tim Hetherington and Chris Hondros were both mortally wounded by another mortar blast around the same time in Misrata.) “My brother’s [torso] was left completely untouched,” she recalls. “But when I picked up his head to kiss him, my hand went through the back of his skull,” where the shrapnel had struck.

In Tripoli, Dalla Abbazi joined two of her brothers in a dangerous scheme to smuggle weapons into the city from Tunisia—an operation that, if exposed, could have gotten them all executed. First she secured a loan of 6,000 dinars (about $5,000) from a Libyan bank; then she sold her car to raise another 14,000 dinars and withdrew 50,000 more from a family fund. Her older brother Talat used the money to purchase two dozen AK-47s and a cache of Belgian FN FAL rifles in Tunisia, along with thousands of rounds of ammunition. He sewed the arms into sofa cushions, packed them into a car and drove across a border checkpoint held by rebels. In the Jebel Nafusa, Libya’s western mountains, he passed the car to brother Salim. Salim in turn smuggled the weapons and ammunition past a checkpoint that led into Tripoli. “My brothers were scared of being caught, but I wasn’t afraid,” insists Abbazi. “I told them not to worry, that if the security agents came to my house, I would take responsibility for everything.”

From her home, Abbazi distributed the weapons at night to neighborhood fighters, who used them in hit-and-run attacks on Qaddafi’s troops. She and other family members assembled pipe bombs and Molotov cocktails in a primitive lab on the second floor of her home. The advantage of Abbazi’s operation was that it remained strictly a family affair: “She had a network of eight brothers who could trust one another, so she could avoid the danger of being betrayed by government informants,” a former fighter in Tripoli told me. Abbazi’s belief in eventual victory kept her spirits high: “What encouraged me most was when NATO got involved,” she says. “Then I was sure that we would succeed.”

As Tripoli was falling to the rebels, Fatima Bredan, the would-be doctor, finally had the opportunity she had been dreaming of for years. On August 20, revolutionaries in the capital, supported by NATO, launched an uprising that they code-named Operation Mermaid Dawn. Using weapons sent overland from Tunisia and smuggled by tugboat, the fighters besieged Qaddafi’s forces. NATO warplanes bombed government targets. Following a night of heavy fighting, rebels controlled most of the city.

In the Tajura district, where Bredan lived, Qaddafi’s snipers were still firing from high buildings when Bredan’s brother, a fighter, handed her a Kalashnikov—she had received military training in high school—and told her to guard hundreds of women and children who had gathered in a shelter. Later that morning came another request: “We are desperate,” he said. “We need volunteers to work in the hospital.”

He guided his sister past sniper fire to a house in a back alley, where she worked for the next 24 hours without sleep, dressing the bullet wounds of injured fighters. The next morning, she moved to Maitiga Hospital—the government compound that had just been liberated. Gun battles continued just outside its walls: “We still didn’t know if this revolution was finished,” she said. More than 100 people filled rooms and spilled into corridors: an old man whose legs had been blown off by a rocket-propelled grenade, a young fighter shot through the forehead. “There was blood everywhere,” Bredan recalled. For days, as rebels cleared out the last resistance in Tripoli, Bredan joined surgeons on rounds. She comforted patients, checked vital signs, cleaned instruments, changed bedpans and caught a few minutes’ sleep during her down time. One morning rebels carried in a comrade bleeding heavily from a bullet wound to his femoral artery. As his life oozed away, Bredan looked on helplessly. “If only I had been properly trained, I could have stopped the bleeding,” she says.

Today, in Sidi khalifa, Abbazi has turned her house into a shrine to the fighters who fell in the battle for Tripoli. As her brothers’ children play in the courtyard, she shows me a poster taped to her window: a montage of a dozen rebels from the neighborhood, all killed on August 20. She disappears into a storeroom inside the house and emerges carrying bandoleers of bullets, a live RPG round and a defused pipe bomb, leftovers from the war.

Abbazi is euphoric about Libya’s new freedoms, and about the expanded opportunities available for women. In September, she began raising money and food for displaced people. With other women in the neighborhood, she hopes to set up a charity for families of war dead and missing. In Qaddafi’s time, she points out, it was illegal for individuals to form private charities or similar groups. “He wanted to control everything,” she says.

After liberation, Inas Fathy, the computer engineer, formed the 17th of February Former Prisoners Association, an NGO that provides ex-prisoners psychological support and helps them retrieve property confiscated by Qaddafi’s forces. Sitting in the hotel lobby, she seems a strong, stoic figure, bearing no apparent scars from her ordeal in Qaddafi’s prisons. But when asked by a photographer to return to Abu Salim prison for a portrait, she says quietly, “I cannot go back there.”

Fatima Bredan will soon cease her volunteer work at Maitiga Hospital, a far calmer place now than during the battle for Tripoli, and return to her job as an Arabic teacher. Bredan stops at the bedside of a former rebel crippled by two bullets that shattered his femur. She promises the man—who has large surgical pins in his heavily bandaged leg—that she’ll help him obtain travel documents from Libya’s (barely functioning) government, to allow him to receive advanced treatment in Tunisia. Leaving the room, she consults with a young medical student about the man’s condition. Knowing that the next generation of doctors will escape Qaddafi’s malign influence, she says, gives her a measure of satisfaction. “When they feel depressed, I cheer them up, and I tell them, ‘This is for Libya,’” she says. “I lost my chance, but these students are the physicians of the future.”

Despite their wartime achievements, most of the women I interviewed believe that the battle for equality has barely begun. They face tremendous obstacles, including a deep-seated resistance to change commonplace among Libyan men. Many women were outraged when the first chairman of Libya’s National Transitional Council, Mustapha Abdul Jalil, in his Declaration of Liberation, failed to acknowledge women’s contributions in the war and, in an apparent bid to curry favor with the country’s Islamists, announced that Libya would reinstitute polygamy. (He later softened his position, stating that he personally didn’t support polygamy, adding that women’s views should be taken into account before any such law was passed.)

Two of 24 members of Libya’s new cabinet, appointed in November by Prime Minister Abdel Rahim el-Keeb, are women: Fatima Hamroush, the minister of health, and Mabruka al-Sherif Jibril, the minister of social affairs. Some women told me that represents substantial progress, while others expressed disappointment that female participation in the first post-Qaddafi government isn’t greater. Yet all the women I interviewed insisted there will be no going back. “I have political aspirations to be in the Foreign Ministry, to be in the Ministry of Culture, which I didn’t think I could ever do, but now I believe I can,” says Amel Jerary, the U.S.-educated spokeswoman for the transitional council. “You have charity organizations, aid groups, in which women are very active. Women are initiating projects now that before they could not dream of doing.”

In Misrata, Asma Gargoum now works as national projects coordinator for a Danish development group that administers a training program for teachers working with children traumatized by war. Her house has been damaged, her brother lies buried in a local cemetery. Tripoli Street, once the vibrant main thoroughfare, is an apocalyptic wasteland. Yet schools and shops have reopened; thousands of displaced residents have returned. Perhaps the most heartening change, she says, is the ascendance of female power.

Misrata now boasts a half-dozen aid and development groups run by women, who have channeled organizational skills honed during the three-month siege into rebuilding post-Qaddafi Libya. In concert with women across the country, Gargoum wants to see more women in the new government and enactment of legislation that would protect women from violence, as well as guarantee them access to justice, health care and psychological support. She, like many others, is prepared to fight for those rights. “We have a brain, we can think for ourselves, we can speak out,” Gargoum told me. “We can go to the streets without fear.”

Joshua Hammer is based in Berlin. Photographer Michael Christopher Brown travels on assignment from New York City.