In a message, Gilani expressed "deep grief and sorrow" at the killing of Karzai's brother.
He conveyed his condolences to President Karzai and his family and prayed for God to grant courage and fortitude to them to bear the loss.
The younger brother of the Afghan president, was shot dead in the southern city of Kandahar today.
A family friend, speaking on condition of anonymity, said Wali had been killed by a bodyguard while entertaining guests at home.
The United Nations said in a quarterly report issued on June 23 that more than half of all assassinations across Afghanistan since March had been in Kandahar.
The killing came just hours before the President held a news conference with French President Nicolas Sarzoky.
"This morning my younger brother Ahmed Wali Karzai was murdered in his home," the Afghan President said. "Such is the life of Afghanistan's people. In the houses of the people of Afghanistan, each of us is suffering and our hope is that, God willing, to remove this suffering from the people of Afghanistan and implement peace and stability."
Pakistan Prime Minister Yousuf Raza Gilani condemned the killing in a statement, calling it an "act of cowardice" and offering his condolences to the President.
Ahmed Wali Karzai maneuvered through a murky, dangerous world of intelligence, Afghan politics and tribal intrigue.
Members of the international community had urged the President to remove his brother from his powerful provincial position, saying that it was essential if he was to prove to the Afghan people that he was committed to good governance.
Noorolhaq Olomi, a former parliament member from Kandahar, said Wali Karzai was the most powerful man in southern Afghanistan -- "more of a governor than the governor" and "everybody's leader in the south, not just Kandahar."
"I cannot say whether this was political or personal or some other matter," Olomi said. "But whoever did it, it shows the weakness of this government. The president needs to change things. He needs to change himself and build a government that is real. Right now, there is no government. It''s all a fraud."
Afghan Interior Minister Bismullah Mohammadi called Wali Karzai "a loyal and faithful servant of the people of Afghanistan."