"The conversations were extremely frank, positive, and constructive," the US embassy said.
Mullen "appreciated the positive role that Pakistan is playing in the war on terror and pledged continued US support to Pakistan," the embassy statement said.
Sources say Pakistani officials told Mullen that unilateral cross-border raids by US ground forces based in Afghanistan would not deal a blow to al-Qaeda and the Taliban.
"Such raids will be a setback to our efforts against the militants' network," the official, speaking on condition of anonymity, told AFP news agency.
Mullen's trip to Pakistan comes after a September 3 ground attack by US troops in South Waziristan, which left 15 people dead.
Kayani had previously said that Pakistani armed forces would protect the country's sovereignty and territorial integrity "at all cost."
Major General Athar Abbas, a Pakistani military spokesman, said that Pakistan would seek to guard its borders.
"We have repeatedly said we will defend our territory and we reserve the right to retaliate in case of any aggression," Abbas said on Wednesday.
Robert Gates, the US defence minister, said in the Afghan capital Kabul that the US will co-operate with Pakistan in an attempt to crack down on Taliban and al-Qaeda bases in the border areas.
He said that recent Pakistani military operations against fighters in the tribal areas were encouraging.