"America's future prosperity and security are tied to our ability to advance peace and security along the arc extending from the Western Pacific and East Asia into the Indian Ocean and South Asia," he told the Class of 2012 during the graduation ceremony at Navy-Marine Corps Memorial Stadium in Annapolis.
"One of your great challenges as an officer in the Navy will be to ensure the peace and prosperity of the Asia-Pacific region for the 21st century."
One thousand and ninety-nine midshipmen received degrees at the academy's 162nd commencement exercises. Eight hundred and ten were commissioned as ensigns in the Navy; 267 were commissioned second lieutenants in the Marine Corps.
"It's been four long years," said Brian Zitterkopf, one of the Marines. "I'm excited to finally get started doing what we came here to do in the first place."
Panetta said the nation "stands at a strategic turning point." Combat troops have returned from Iraq, and NATO approved a plan last week to hand all security responsibilities in Afghanistan to Afghan forces by the end of 2014. Much of the leadership of al-Qaida has been captured or killed, and "we successfully fought with our NATO allies to give Libya back to the Libyan people."
"And yet we still face significant challenges and risks," he said. He cited "those who continue to threaten attacks on our homeland," the proliferation of weapons of mass destruction, the "destabilizing behavior of Iran and North Korea," military modernization across the Asia-Pacific, piracy on the high seas, and increasing cyberattacks at home and abroad — all at a time of "increasing budget challenges."
"Our nation now looks to you, the next generation of military leaders, to confront these challenges … and to ensure that America always has the strongest military force in the world."
Panetta told the midshipmen that many could expect to serve in the Pacific region at some point in their careers.
"We need you to do the important work of strengthening and modernizing our historic alliances with Japan, with Korea, with Australia, with the Philippines, with Thailand," he said. "We need to you to build robust partnerships throughout the region — with countries such as Malaysia and Indonesia, with Vietnam, Singapore, India and others.
"We also need you to strengthen defense ties with China. China's military is growing and modernizing. We must be vigilant. We must be strong. We must be prepared to confront any challenge."
Zitterkopf, of Pace, Fla., said the midshipmen were ready.
"We'll go wherever they tell us to go, and we'll do our best job," he said.
Panetta paid tribute to Lt. Cmdr. Wesley A. Brown, the first African-American to graduate from the academy. Brown, who grew up in Baltimore, died last week at age 85.
Tuesday's ceremony saw the graduation of the academy's first openly gay midshipmen. Don't Ask, Don't Tell, the policy that barred gay service members from discussing their sexual orientation, was ended in September.
Panetta alluded to the milestone when he described the diversity of the Class of 2012: "You are men and women from every state in the Union and 12 foreign nations, rich and poor, secular and religious, black, white, Latino, Native American, Asian, straight and gay."
The stadium cheered for Midshipman Kevin Hillery, paralyzed in a biking accident in April 2011, as he used a wheelchair to mount the platform and accept his degree. He was not commissioned as an officer; he has told news organizations that he hopes to study law.
The graduating class included 14 foreign nationals who will now serve in their own countries. For the first time, one of these, Sam Tan Wei Shan of Singapore, graduated first in the class.
The new Navy and Marine Corps officers will deploy for more training and assignments. Ensign Sarah Bull, a surface warfare officer, is headed for San Diego and the amphibious assault ship the USS Essex
"It's just all really exciting," Bull, of Greensboro, N.C., said moments after tossing her cap in the air with the rest of the class. "I know they've prepared us here, but it's going to be a whole new world out there."