"As soon as worshippers from inside the mosque tried to come out, a suicide bomber dressed in black got close to the gate and detonated his explosive device," he said.
Fedayeen al-Islam, a little-known group believed linked to the Taliban, claimed responsibility for the attack through a spokesman.
The bomber set off his explosives at the entrance to the mosque during a religious congregation, Nadim Hasan Asif, a senior security official in Punjab, said.
"The suspected man was stopped at the entrance and pushed himself in and exploded," he said.
Another police officer, Nasir Khan Durrani, said the attack could have been much worse.
"Had he succeeded in exploding inside it could have caused a much bigger loss because there were hundreds of people inside," he said.
Chaudhry Nasrullah, the chief health officer of Chakwal, said that 22 people were killed and more than 50 others injured, a dozen of them critically.
He appealed to the government to send helicopters to evacuate the most seriously wounded.
Yousuf Raza Gilani, the Pakistan prime minister, condemned the mosque attack.
He said it was masterminded by people who are against the state and want to give Islam a bad name.
Our correspondent said "there are more people dying in Pakistan on some days than Iraq and Afghanistan put together".
"The country's war on terror is unpopular, Pakistan's US alliance is becoming even more unpopular ... and that is threatening the stability of Pakistan itself," he said.
Shias make up at least 20 per cent of Pakistan's Sunni Muslim-dominated population of 160 million people.
Although the two groups usually coexist peacefully, at least 4,000 people have died in outbreaks of sectarian violence since the late 1980s.
As police launched investigations into the Chakwal bombing, Baitullah Mehsud, a Pakistani Taliban commander, claimed responsibility through a spokesman for late Saturday's deadly attack in Islamabad.
Eight paramilitary police officers were killed when a suicide bomber blew himself up in their tented camp.
Hakimullah, a close aide of Mehsud, said it was in retaliation for US drone missile attacks against fighters in Pakistan near the Afghan border.
"We claim responsibility for the Islamabad suicide attack. It was in retaliation for a drone attack in Orakzai," Hakimullah said.
"In Islamabad we have been successful ... and we will launch more attacks in retaliation for drone attacks."
Mehsud's fighters have also said they carried out the March 30 attack on a police academy in Lahore that left 12 people dead, including seven policemen.