WASHINGTON — President Barack Obama and challenger Mitt Romney declared a fleeting truce for partisan digs Tuesday as the nation remembered the 9/11 terrorist attacks, but campaign politics crackled through even their somber observances.

The campaigns pulled their negative ads and scheduled no rallies. But both candidates stayed in the public eye as the nation marked the 11th anniversary of the jetliner crashes that left nearly 3,000 dead.

Obama observed a White House moment of silence, attended a memorial service at the Pentagon, visited Arlington National Cemetery and met privately with wounded soldiers and their families at Walter Reed National Military Medical Center.

Former President Bill Clinton carried on with a campaign stop for Obama in Florida, and his camp issued registration appeals.

In an echo of his usual campaign speech, Obama noted that the war in Iraq is over and troops are on track to leave Afghanistan in 2014.

“Al-Qaida’s leadership has been devastated, and Osama bin Laden will never threaten us again,” Obama said at the Pentagon. “Our country is safer and our people are resilient.”

Romney, in Reno, Nev., to address a meeting of the National Guard, indirectly but clearly drew distinctions with Obama by spelling out his own national security goals.

“I wish I could say the world is less dangerous now,” he said.

After declaring that the day was not the proper moment to address differences with the president, Romney took issue with threatened cuts in defense and the handling of disability claims, and he called for more assertive international leadership.

“This century must be an American century,” Romney said. “It is now our duty to steer it onto the path of freedom, peace and prosperity. America must lead the free world, and the free world must lead the entire world.”

He alluded to his criticism of Obama over threatened cuts in military spending that would kick in if Congress and the president do not find agreement on major federal deficit reductions.

While acknowledging that the war in Iraq is over and the U.S. is on a path to exit Afghanistan, Romney said, “The return of our troops cannot and must not be used as an excuse to hollow out our military through devastating defense budget cuts.”

Obama has insisted on a deficit deal that includes spending cuts and tax increases. Romney has blamed Obama for negotiating a deal that would require steep Pentagon cuts if a broad deficit agreement is not reached.