WASHINGTON — Republican Senator John McCain praised US Secretary of State Hillary Clinton for taking blame Monday for shortcomings in last month's Libya attack, but said "the buck stops" with the president on security issues.

"This is a laudable gesture, especially when the White House is trying to avoid any responsibility whatsoever," McCain, in a statement issued along with fellow Republican Senators Kelly Ayotte and Lindsey Graham, said of Clinton.

The top US diplomat, visiting Peru, said she took "responsibility" for the handling of the deadly attack last September 11 on the US consulate in the Libyan city of Benghazi.

She also sought to absolve President Barack Obama from blame, saying he and Vice President Joe Biden "certainly wouldn't be knowledgeable about specific decisions that are made by security professionals."

But McCain insisted that either there were drastic failures in the national security operation in not keeping the president aware of ongoing threats, or Obama himself knew of the threats and needed to take responsibility for the shortcomings.

"We must remember that the events of September 11 were preceded by an escalating pattern of attacks this year in Benghazi, including a bomb that was thrown into our consulate in April, another explosive device that was detonated outside of our consulate in June, and an assassination attempt on the British ambassador," the three senators wrote.

"If the president was truly not aware of this rising threat level in Benghazi, then we have lost confidence in his national security team, whose responsibility it is to keep the president informed," they said.

"But if the president was aware of these earlier attacks in Benghazi prior to the events of September 11, 2012, then he bears full responsibility for any security failures that occurred," the trio added.

"The security of Americans serving our nation everywhere in the world is ultimately the job of the commander-in-chief. The buck stops there."

They also raised questions about why the administration insisted on blaming the attack on a "spontaneous demonstration triggered by a hateful video," even after it was clear that the cause was a terrorist attack.

"We continue to believe that the American people deserve to know why the administration acted as it did," the senators said.