"The armed forces have been called in to eliminate the militants and terrorists," he said.
Asif Ali Zardari, Pakistan's president, said military operations would last until "normalcy" returns.
"It is going to carry on until life in Swat comes back to normalcy," he said at the US Capitol Hill after meeting influential senators.
Swat is a part of the Malakand division of Pakistan's volatile North West Frontier Province (NWFP).
Al Jazeera's Sohail Rahman, reporting from Pakistan, said: "[There has been] a lot of pressure on the government that they have acted a bit too late in giving the army the greeen light.
"I think the army have been looking for official civilian backing for their action and the public perception would be that they would not be blamed for attacking the Taliban. It was a civilian decision made by the civilian government."
The latest bout of fighting has all but extinguished the peace deal between the government and the Taliban.
It has also forced more than 300,000 residents caught up in the combat zone to flee from their homes, with Red Cross officials warning that the region faces a rapidly escalating humanitarian crisis.
Our correspondent said: "The military operation continues and it is going to continue for sometime. These are not easy areas [where fighting is taking place].
"It is not a conventional war. It is very much a guerrilla war from the Taliban side, and therefore the military don't have specific targets to go for and that is why helicopter gunships are the main tool that the military are using.
"[But] they [the military] can only use them when the weather is good, and last weekeend we saw very bad weather and a halt to those operations. They resumed again on Monday and Tuesday."
|Pakistan's Pm has said the offensive will last until "normalcy" is restored [AFP]
In his address, Gilani accused the Taliban of threatening Pakistan's sovereignty and violating the peace deal.
That agreement, brokered by a local religious leader, sought to put three million Pakistanis in a wide region of the NWFP under sharia law, in exchange for the Taliban agreeing to end a nearly two-year uprising.
"In order to restore honour and dignity of our homeland, and to protect people, the armed forces have been called to eliminate the militants and terrorists," Gilani said.
"The time has come when the entire nation should stand side by side with the government and the armed forces against those who want to make the entire country hostage and darken our future at gunpoint."
The Pakistani military says it has killed more than 80 fighters in recent heavy fighting in Swat, Buner and Lower Dir, all part of Malakand.
At the same time, to avoid getting caught in the crossfire, thousands of residents have fled the three districts for the safety of camps for internally displaced people (IDP).
The army launched its major offensive on Wednesday, with reports of aerial support being used overnight into Thursday.
Talat Masood, a retired general who worked in Pakistan's defence ministry, told Al Jazeera that Pakistan was "probably paying a price for the wrong policies it has pursued".
He said that if action had been taken much earlier - months before or even during President [Pervez] Musharraf's time, the "state of affairs that we find today would not have happened".
"And these militant forces, they would not have been of much strength," he said.
The government said it was preparing to shelter up to 500,000 refugees, while the Red Cross warned of a mounting humanitarian crisis in the region.
The ICRC said that they were marshalling aid to provide for 120,000 people, but could no longer reach the areas most affected by violence.
Al Jazeera's Kamal Hyder, reporting from Peshawar, the capital of NWFP, said: "Hundreds of thousands of people are stranded along the highway between Mingora and Malakani. They were stranded because of heavy fighting that took place last night, which prompted the authorities to impose an indefinite curfew. [It is] a desperate situation ...
"The biggest concern as we spoke to the ICRC [International Committee of the Red Crosss] this morning is the number of people moving. They said they were triying to help in whichever way they could ... Many people who are stuck inside Swat are asking the government why there was no plan; why they were not given adequate warning to get out and save their souls."
Sebastian Brack, a spokesman for the International Committee of the Red Cross (ICRC) in Pakistan, told Al Jazeera that their immediate concern was access to the victims of the fighting.
"Large number of people stuck in areas where fighting is taking place cannot escape," he said.
"We are preparing ourselves to be able to act as soon as the situation allows - hopefully by the end of next week - to be able to bring in help: emergency food, shelter, blankets and also medical care."