"While these operations were being carried there was intense firing from the militants," he said. The unit commander was killed and one commando wounded.
Hundreds of troops have been surrounding the Lal Masjid, or Red Mosque, in Islamabad since Tuesday when clashes between the armed students and security forces began after months of tension.
Security forces have not mounted a full-scale assault on the compound because of fears for the safety of hundreds of women and children who the government says are being held as human shields.
Instead, troops have been blasting holes in the wall to provide escape routes for those inside.
The death toll in the standoff since Tuesday is at least 21.
Abdul Rashid Ghazi, the cleric leading the Lal Masjid's Taliban-style movement, said up to 80 people had been killed inside his compound. The government dismissed that.
Ghazi has refused to surrender, saying he would prefer "martyrdom". He also rejected the accusations he was holding women and children as human shields.
Fifty to 60 fighters were believed to be leading the fighting, officials said.
Water, gas and power to the mosque were cut and food was said to be running short. Security forces have occupied another city madrassa linked to the Lal Masjid.
Ghazi said he and his followers would lay down their weapons but would never accept arrest.
About 1,200 students left the mosque after the clashes began but only about 20 have come out since Friday.
Waheed said some had slipped out of the breaches troops were making.
Officials said they did not know how many people remained inside but there could be up to 2,000.