GUADALAJARA, Mexico - From the first gold right up until the end, the United States was in the mix for medals at the Pan American Games.

The Americans won the first gold of the 16-day multisport event when Heather Irmiger earned the title in women's mountain biking. They didn't get a gold on the final day, but they did earn two bronze medals in yesterday's three events.

"Our whole goal was to reach the podium. That's what the USOC wanted," U.S. rugby sevens coach Al Caravelli said. "We would have liked for it to be higher than bronze, but for our first outing - for some of these younger players - they did an outstanding job."

In the medals table, the United States finished way out ahead with 92 gold and 236 overall. Cuba, which came on strong in the second week of competition, ended up in second place with 58 gold and 136 overall, while Brazil was third with 48 gold and 141 overall.

Brazil's final gold medal came on the last day of competition when Solonei Silva won the men's marathon.

Silva, who had been working as a garbage man until 2 years ago, won the race in 2 hours, 16 minutes, 37 seconds. Colombian teammates Diego Colorado and Juan Cardona took silver and bronze.

"I won this medal through sacrifice and a 4-month preparation," Silva said. "People always ask me about my past and I always answer the same thing: I'm very proud of it and now I want to keep working hard as an athlete and train in physical education."

The Americans got their first bronze of the day in men's basketball, beating the Dominican Republic, 94-92. The United States had not won a medal in the event since 1999, and last won gold in the sport in 1983.

"We came here and we got a medal, that was one of our goals," said U.S. forward Lance Thomas, who scored a team-high 14 points. "We played a pretty tough Dominican Republic team. They fought until the end."

Puerto Rico ended up with the gold, beating Mexico, 74-72. The Puerto Rican women also won gold in basketball.

The second bronze for the United States came in rugby sevens, which will make its Olympic debut at the 2016 Rio de Janeiro Games. After losing to Canada, 21-19, in the semifinals, the Americans beat Uruguay, 19-12.

In the first rugby sevens final at the Pan American Games, Canada beat Argentina, 26-24.

But even though the Americans came up short of gold on the final day, they had plenty to celebrate over the 2 weeks.

The swimmers from the United States won 18 gold and 44 overall in the pool. Besides Brazil with 10 golds, no other country won more than one swimming title. And in fencing, the Americans were even more consistent, winning 11 of the 12 gold medals.

The Cubans won almost half of their gold medals in only two sports - 18 came in athletics and eight more came from nine finals in boxing.

Host Mexico finished in fourth place in the medals table, well ahead of Canada.