Sarah Elliott for The New York Times

NEAR BANI WALID, Libya — The rebel fighter, in a billowing white “Free Libya” T-shirt, jeans, scarf and camouflage cap, was leaning against a car, talking in a businesslike manner with other rebels.

It took a few long stares to realize that this fighter was a woman, the only Libyan woman in sight.

She was one of hundreds of rebels at this roadside outpost — a mosque, clinic and store dwarfed by the desert landscape massing for a possible assault on the pro-Qaddafi stronghold of Bani Walid. They had been there for days, and the sleeves of her shirt were brown with desert dust.

Her name was Miriam Talyeb. She was 32 years old, a dentist and seven months pregnant with her first child. Her husband was part of the brigade of fighters who carried assault rifles and drove trucks mounted with rocket launchers.

“I don’t care if I get shot or if I die,” she said. “I want to do this for God and for Libya. I want to be free. You must fight to take your freedom, especially here in Libya.”

Women have played a large part in Libya’s revolution, buying and delivering arms, sheltering fighters, demonstrating, cooking and spying on the forces of Col. Muammar el-Qaddafi. Since the colonel’s forces fled Tripoli, it has been common to see women posing for pictures with guns in the newly renamed Martyrs’ Square. But in carrying her own weapon into battle, Ms. Talyeb is unusual, as is her husband, for supporting her decision to fight.

“He’s proud of me, I’m sure,” she said. She said she knows a few other women who have fought with weapons, but that most stayed in support roles. “Maybe they don’t have inner strength like me,” she said in English.

She began her revolutionary work like other women — going to protests, and later cooking and cleaning for the fighters. In February, as the revolution began, she and her husband were arrested in Tripoli. She was in custody for about nine hours, she said. A security officer told her that if she didn’t stop demonstrating, “I will rape you.” It was particularly painful, she said, that he made the threat in front of her husband.

But she did not stop demonstrating.

When she saw that security forces kept using force against unarmed protesters, she said, she decided she wanted a rifle “to protect myself and to protect my people.”

She did not use it, though, until fighting came to Tripoli. She was with rebel battalions from the rebel stronghold cities of Misurata and Zintan as they clashed with pro-Qaddafi forces in the neighborhoods of Bab al-Aziziya and Abu Salim. She was driving an ambulance, she said, but came under fire and fired back.

“So from these days I know what the fighting is like,” she said.

Now, she said, she hopes negotiations for Bani Walid’s surrender bear fruit, because she is from there and has relatives inside the city. But she is ready to fight if necessary.

Being pregnant does not slow her down.

“I have to be strong for what I believe in,” she said.

She said she was not afraid of being hurt, but she was afraid of harm to her unborn daughter. Still, she said, “it’s for her freedom too.”

“My daughter,” she added, “will be called Misurata.”