President Obama appeared at a series of events here Tuesday, becoming the first U.S. president to visit the island in more than three decades, in a largely symbolic trip that could aid his 2012 reelection prospects.

Rolling his R’s as he declared “buenas tardes” (good afternoon), Obama emphasized the ties between the rest of the United States and the commonwealth of Puerto Rico.

“Every day, Boricuas help write the American story,” he told a cheering crowd of more than 1,000 at a speech in the hangar of a San Juan airport. “Puerto Rican artists contribute to our culture . . . Puerto Rican entrepreneurs create American jobs. Even in the NBA finals, [Dallas Mavericks guard] J.J. Barea inspired all of us with those drives to the hoop. That guy can play.”

Obama cast the visit as simply living up to a promise he made in 2008, when he was running in the island’s Democratic presidential primary, to come back if elected.

But the trip had obvious political overtones. Although the nearly 4 million people who live on the island cannot vote in the U.S. general election, those who have moved to one of the 50 states can. Both parties consider the 4.6 million Puerto Ricans in the United States an important voting bloc, particularly the nearly 900,000 in Florida, a key swing state for Obama’s 2012 campaign.

Most Latinos nationwide supported Obama in 2008. But his sagging popularity among independent voters since the election makes it critical that he retain strong support from the group next year.

Cubans, who make up the largest group of Latinos in the Sunshine State, have traditionally backed the GOP because of its historically strong stance against Cuban dictator Fidel Castro. Democrats have argued that their party is more supportive than the GOP of immigration reform, but that is less important to Puerto Ricans, who are U.S. citizens.

“The large and growing Puerto Rican population in central Florida will be key to winning the state in 2012,” said Simon Rosenberg, president of the Democratic-leaning NDN, which has advised the party on how to reach Latino voters.

Although Puerto Ricans can serve in the armed forces and vote in presidential primaries, the island does not have voting representatives in Congress.

Many in Puerto Rico prefer that the island remain a commonwealth, but others are pushing to become a U.S. state, and a small number want independence. Following a pattern of presidents of both parties, Obama has not taken an official position on the issue, instead calling for Puerto Rico to hold a plebiscite to resolve its status.

“When the people of Puerto Rico make a clear decision, my administration will stand by you,” he said in his speech.

The island is also struggling economically, with an unemployment rate above 16 percent. Obama pledged to work to increase job growth. But his four-hour visit was mainly about paying homage to Puerto Ricans.

He ate a medianoche sandwich at a San Juan restaurant, spent time at the governor’s office and attended a closed-door fundraiser.

Obama was the first U.S. president to visit the island since Gerald R. Ford in 1976. And John F. Kennedy was the last president to give a speech to the Puerto Rican people in San Juan.

As Obama’s motorcade rolled through the city, thousands of spectators waved American flags and took pictures. Signs on the streetlights included side-by-side photos of Kennedy and Obama, noting the years of their visits (1961 and 2011) and declaring “we are proud to be part of history.”

“We’re really happy he came here, especially a place like this that is local,” said Jose Rodriguez Garrido, who was eating at the restaurant Kasalta when the president arrived there. “There’s lots of excitement. We’re very friendly people and we enjoy visitors.”