The New York Yankees paid tribute to closer Mariano Rivera and his 19-year-career right before their game against the San Francisco Giants on Sunday.

The tribute was a fitting send-off to the 43-year-old relief pitcher, who is also the sport's all-time saves leader with 652. The ceremony, which lasted 50 minutes, included appearances by former teammates, the retirement of Rivera's legendary #42 jersey, and a performance by a heavy metal band.

As Metallica played their 1980s hit Enter Sandman, Rivera stepped on to the field, as he had been doing since 1999. He addressed fans during the ceremony, expressing his gratitude for their support.

"It's been a great run and you guys have been amazing ... You will have a part of my heart here in New York," Rivera said during the tribute. After Rivera's speech, the Yankees screened a video tribute featuring teammates such as Derek Jeter and Andy Pettite. He was joined at center field by former manager Joe Torre, Bernie Williams, and Tino Martinez, among other Yankees legends.

Rivera's jersey number, 42, was retired by the league in honor of Jackie Robinson, the first African-American to play in the big leagues. This made Rivera the last active player to use the number, and he took great pride in that honor. Robinson's wife and daughter also attended the tribute.

While the tribute brought tears to the eyes of everyone in attendance, Yankees fans had little else to celebrate as New York lost to the visiting Giants, putting them in the precarious position of missing the playoffs for just the second time in 19 seasons.

After giving up a home run to Ehire Adrianza in the sixth inning and a leadoff double to Pablo Sandoval in the eighth, Andy Pettite was pulled out by manager Joe Girardi. Pettitte, who had also ealier announced his re-retirement after the 2013 season, was cheered as he made his way back to the dugout.

The loss drops the Yankees four games behind Cleveland for the second AL wild card with only six games left. New York will next host Tampa Bay, which leads the wild-card race, then will fly to Houston for the season closer.