U.S. Defense Secretary Mark Esper delivers a speech during a commemoration ceremony for the 75th anniversary of the Battle of the Bulge at the Mardasson World War II memorial monument in Bastogne, Belgium December 16, 2019. REUTERS/Francois Lenoir/File Photo

WASHINGTON/BAGHDAD (Reuters) - U.S. Defense Secretary Mark Esper said on Monday he spoke with Iraqi Prime Minister Adel Abdul Mahdi amid a spate of attacks on bases housing U.S. forces in Iraq and called on Baghdad to take steps to get the situation under control.

A senior U.S. military official warned last week that attacks by Iranian-backed groups on bases hosting U.S. forces in Iraq were pushing all sides closer to an uncontrollable escalation.

Rocket strikes targeting Iraqi bases where members of the U.S.-led coalition are also stationed have increased in past weeks with no claim of responsibility from any party.

“We need their help in terms of getting the security situation under control and stabilized, but we also still retain our right of self-defense and we will exercise it,” Esper told reporters after a trip to Europe.

Asked who was behind the recent rocket attacks, Esper said: “My suspicion would be that Iran is behind these attacks, much like they are behind a lot of malign behavior throughout the region, but it is hard to pin down.”

Earlier on Monday, Abdul Mahdi’s office said in a statement that Esper urged the premier to take steps to prevent bases housing U.S. troops from being shelled.

Abdul Mahdi warned Esper that unilateral action could have negative consequences that would be difficult to control and might jeopardize Iraq’s sovereignty.

Abdul Mahdi resigned last month under pressure from mass anti-government protests. He is carrying out his duties in a caretaker capacity.

Tension between the United States and Iran has risen as a result of U.S. sanctions that are hitting Tehran hard. The two sides have also traded blame over attacks on oil installations, militia arms depots and bases hosting U.S. forces.