Yousaf Raza Gilani made the pledge on Saturday in his first policy speech in parliament since lawmakers elected him earlier this week.
Earlier Saturday, lawmakers passed unopposed a motion expressing confidence in Gilani, a loyalist of assassinated former premier Benazir Bhutto.
In his speech, Gilani said extremism was a serious problem for Pakistan. Restoring pace and eliminating terrorism are "our top priority," he said.