Gilani made the remarks while chairing a meeting of the Defence Committee of the Cabinet. The meeting was attended by federal ministers, the Joint Chiefs of Staff Committee Chairman and the three service chiefs.
Authorities need to clearly identify the threat posed by terrorism, including underlying factors such as ideology and motivation, funding, weapon supplies, training, organisational support for terrorist groups and those aiding and abetting terrorists, Gilani said.
"Our intelligence and security agencies have been tested to the limits," he added.
Pakistan was "passing through a difficult period" and issues related to the criminal justice system and terrorism, particularly suicide attacks, had seriously affected the citizens, he said.
Both criminal justice and terrorism need to be addressed effectively in a comprehensive manner, he said.
Consultations, cooperation and coordination between all arms of the government, most notably the intelligence agencies and law enforcing bodies, is a prerequisite for ensuring national security, Gilani told the gathering.
The government wants all institutions to play their role effectively and with a high degree of coordination to safeguard and promote national interests, he added.