University of Wyoming, Associated Press
In this image taken from video and provided by the University of Wyoming, Gen. James Mattis, commander of U.S. Central Command, speaks to students, faculty and others about military and political affairs in the Middle East, Thursday, Oct. 4, 2012 in Laramie, Wyo. Mattis says insider attacks by Afghans on international troops in Afghanistan are disheartening but won't diminish the U.S. commitment in the country.

LARAMIE, Wyo. — Attacks on international forces by Afghan soldiers and police are disheartening but will not diminish the United States' commitment in Afghanistan, said Gen. James Mattis, the top U.S. commander in the Middle East.

"We are going to continue to work with the Afghan forces," Mattis said Thursday during a visit to the University of Wyoming.

So-called insider attacks by Afghan forces or insurgents who infiltrated the Afghan forces have claimed more than 50 American lives this year.

Mattis said such "treachery always has been part of warfare throughout history."

He noted Afghan soldiers also have died from these tactics and said measures are being taken to reduce the attacks.

"What we won't do is, we're not going to pull back," he said. "We're not going to say they all sleep over in that compound, we'll sleep over here."

Thousands of patrols are conducted each day by Afghan soldiers accompanied by international troops, he said.

Mattis is commander of U.S. military operations in the Middle East, which includes Afghanistan, Egypt, Iran, Iraq, Pakistan and Syria.

He spoke to about 500 people in a visit initiated this summer by relatives he has in Laramie.

Mattis noted his biggest worry every day in the region is Iran. He said Iran is involved in helping Syrian President Bashar Assad suppress rebels, and it supports terrorist groups and criminal acts elsewhere.

"Iran is right now acting as a rogue state, and it is of deep concern," he said.

Mattis also expressed confidence in the Arab Spring movement because of Egypt.

He noted the Egyptian military protected a political process that resulted in the election of a president who is a member of the Muslim Brotherhood.

In addition, Egyptian military leaders have voiced maintaining close ties with the U.S. military, he said.

"How Egypt goes in the Arab awakening will probably have a lot to do with how the whole region goes," he said.

Mattis downplayed the recent escalation in military clashes between Syria and Turkey.

He believes that responses by Turkey — a NATO ally — to Syrian shelling are not a "call to arms."