The United States and Egypt on Sunday resumed formal security talks that were last held six years ago and kept on hiatus until now amid the political unrest that swept the country in the wake of the Arab Spring.

Two days after the U.S. delivered eight F-16 warplanes to Egypt as part of a military support package, Secretary of State John Kerry restarted the dialogue with Egyptian officials in Cairo.

Kerry, on the first stop of a Mideast trip aimed at assuaging Arab concerns over the nuclear deal between Iran and world powers, began his day in talks with Egyptian Foreign Minister Sameh Shoukry. He later will see President Abdel-Fattah el-Sissi before leaving for Qatar, where he will hold discussions with Gulf Arab foreign ministers on the Iran deal and its implications for the region.

Despite ongoing human rights concerns in Egypt, the Obama administration is increasing military assistance to the country as it confronts growing threats from extremists, particularly in the Sinai Peninsula. That aid had been on hold until earlier this year due to human rights and democracy concerns in the wake of the military overthrow of Islamist President Mohammed Morsi in 2013.

"We are absolutely clear that terrorists who kill civilians and attack Egyptian security forces have to be brought to justice, and we stand with Egypt in that effort. But it is equally important ... to distinguish between those who use violence to achieve their ends and others who seek peacefully to participate in a political dialogue, even if what they say sometimes may make people uncomfortable," Kerry said at a news conference with Shoukry.

Earlier he told Shoukry that the U.S. would "continue to provide robust training to the Egyptian military, as the military seeks it and desires it, in an effort to build capacity, and also to meet the highest expectations of your military for its professionalism." He noted that in addition to the F-16s, the U.S. had provided Egypt with Apache helicopters, attack boats, armored vehicles and other weapons systems this year.

But Kerry said that fighting extremism requires more than military might and called on Egypt to adopt a broad strategy that would both improve the economy and accept dissent to prevent young people from embracing radical ideologies. "Otherwise, no matter how many terrorists we bring to justice, those groups will replenish their ranks and we will not be safer. We will be involved in a round robin, circular, repetitive process," Kerry said.

"The success of our fight depends on building trust between the authorities and the public," he said. "If that possibility does not exist, more misguided people will be driven to violence and there will be more attacks."

U.S. lawmakers and advocacy groups had urged Kerry to raise human rights issues, including the arrests of dissidents and journalists and mass trials, and his trip came as a verdict was again postponed in the trial of three Al-Jazeera English journalists, whose arrests have sparked widespread condemnation. Shoukry said no journalists have been detained in Egypt for doing their jobs, only for terrorism and other offenses, and he rejected criticism that detainees were being denied due process.

Kerry acknowledged stress in the U.S.-Egypt relationship over human rights. "Obviously, there has been a little bit of tension over certain issues," he said.

But he said he had stressed the importance of respecting people's rights to free speech and expression, especially ahead of parliamentary elections later this year.

Kerry said he and Shoukry had agreed "on the importance of ensuring free, fair, and transparent parliamentary elections in Egypt this year that are open to all peaceful political actors." He added that they had also discussed the need for comprehensive police and judicial reforms."

Shoukry said Egypt is committed to improving its human rights conditions but noted that all countries, even mature democracies, have imperfect rights records.

In advance of his trip, Kerry met Thursday in Washington with Egyptian-American Mohammed Soltan, who had been sentenced to life in prison in Egypt for financing an anti-government sit-in and spreading "false news." One of thousands imprisoned after Morsi's overthrow, Soltan had been on a hunger strike for more than a year before being freed in May after repeated U.S. requests. He is the son of a prominent member of the now-outlawed Muslim Brotherhood.

Broadening U.S.-Egyptian trade and economic ties also was also on the table during Kerry's visit, which comes just days before Egypt inaugurates a second, parallel waterway to allow two-way traffic on the Suez Canal. Egyptian officials are hoping the opening will boost a flagging economy. Kerry congratulated Egypt on the "major" Suez project ahead of its opening on Thursday, and he announced that U.S.-Egypt trade and investment consultations will resume in the fall.

On Iran, Kerry said he would be traveling to Doha to make the case to members of the Gulf Cooperation Council that the Iran nuclear agreement will make the Middle East more secure. The Gulf Arab states have publicly welcomed the deal reached last month in Vienna but many have expressed private reservations.

"There can be absolutely no question that the Vienna plan, if fully implemented, will make Egypt and all the countries of this region safer than they otherwise would be or were," he said.

Saudi Arabia is the largest and most influential member of the council and has been publicly supportive of the Iran deal, albeit with reservations. Just this week, the State Department authorized the sale to Saudi Arabia of $5.4 billion in Patriot missiles and related equipment along with $500 million in ammunition.

Kerry is not going to Israel, which is vehemently opposed to the accord, on this trip.