President Obama at Carrier Classic

CORONADO, Calif. -- Soaking in one of the most spectacular settings of his time in office, President Barack Obama pledged an unwavering commitment to veterans Friday from the deck of an aircraft carrier doubling, for one night, as a gleaming basketball court.

The president's patriotic message to the military crowd, while welcomed, was secondary to the scene itself. The players from two storied basketball programs, No. 1 North Carolina and Michigan State, competed aboard the USS Carl Vinson in the open air, in the dusk of a perfect San Diego evening.

Basketball star power was on hand in the form of Magic Johnson and James Worthy, former teammates on the Los Angeles Lakers and alums of Michigan State and North Carolina, respectively.

The first-ever Carrier Classic gave Obama a chance to honor troops and pay tribute on the 95,000-ton Navy warship that buried Osama bin Laden's body at sea. For the hoops-loving president, topping it all off with a college basketball game played outside and on water was surely unforgettable.

"Every American citizen can make a solemn pledge today that they will find some opportunity to provide support to our troops, to those who are still active duty, to our national guard, to our reservists and to our veterans," Obama told the crowd before the game got under way.

"It's especially appropriate that we do it here," Obama said, referencing the carrier's role in "that critical mission to bring Osama bin Laden to justice." He later observed to an ESPN interviewer that "this is the last time Osama bin Laden was on the face of the earth, so there's a lot of history on this ship."

A day after the Senate acted in unusual bipartisan agreement to pass a small piece of the president's jobs bill aimed at helping veterans, Obama said that to support veterans was "a sacred trust."

"That gratitude we have for the men and women in the armed forces does not stop when they take off the uniform," he said.

The president was also asked about a new policy approved by the NCAA allowing conferences to add up to $2,000 annually to athletic scholarships to help cover the full cost of attendance. While saying he wasn't familiar with the specific proposal, Obama said he supported the general idea that student athletes stay amateur but also have all of their expenses covered.

"They're bringing in billions of dollars into all the institutions that they support," he said. "I hope that we're able to preserve that sense of amateur athletics that makes college sports so terrific."

Obama said that even though he plays golf, basketball remains his favorites sport.

"I play golf for two reasons. One, it's my only excuse to get outside, and two, I'm getting too old to play basketball," the 50-year-old chief executive said. "But when it comes to true love, basketball will always be first in my heart."

There were about 7,000 people in the crowd, both teams wore camouflage versions of their regular uniforms and two fighter jets screamed right above the carrier anchored off the coast of San Diego just as the singing of the national anthem was reaching its final notes.

Once the game started Obama, wearing a bomber jacket, watched from the sidelines, looking thrilled, as Michelle Obama looked on at his side.

Despite the unusual setting, it quickly turned into a real basketball environment as the sun set and night fell over the giant warship.

"Can we get a call, ref?" one sailor shouted.

"Get your head in the game!" said another.

The court was surrounded by stands of fans, so no loose balls had a chance of splashing in the water.

North Carolina won 67-55.

Obama's stop in San Diego was the first leg of a nine-day diplomacy mission he's embarking on, to Hawaii, where the U.S. is hosting an economic summit for the Asia-Pacific, and from there to Australia and Indonesia. He is aiming to use the trip to create bonds and boost U.S. business in the region before arriving back in Washington Nov. 20.

Information from The Associated Press contributed to this report.