Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

President Barack Obama celebrated the World Series champion Chicago Cubs on Monday and spoke about the power sports has to unite people.

"Throughout our history, sports has had this power to bring us together even when the country is divided," Obama said at a White House ceremony for his hometown team. "Sports has changed attitudes and culture in ways that seem subtle but that ultimately made us think differently about ourselves."

PHOTOS: Cubs Celebrate Title That was 108 Years in the Making

"It is a game and celebration," he said, and noted that "there's a direct line between Jackie Robinson and me standing here." Robinson, a second baseman for the Brooklyn Dodgers, broke Major League Baseball's color line to become its first black player.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Obama holds a lifetime admission certificate. Yuri Gripas / AFP - Getty Images

The White House event came four days before Obama hands the presidency over to Donald Trump following one of the most divisive elections in recent memory.

It also follows a weekend in which civil rights icon John Lewis said he didn't consider Trump a legitimate president because of Russian meddling in the election. Trump responded on Twitter by criticizing Lewis as "all talk" and suggesting the Democratic congressman take better care of his Georgia district.

Obama has a home in Chicago, but is a longtime White Sox fan. He rooted for the Cubs after the Sox failed to reach the playoffs.

His wife, first lady Michelle Obama, however, is a lifelong Cubs fan. She greeted Cubs players before the ceremony, which Obama noted was her first appearance at some of the roughly 50 events he has hosted for championship college and professional sports teams.

The Cubs gave Obama two baseball jerseys — home and away — with the number 44, among other gifts. Cubs first baseman Anthony Rizzo also wears the number, and Obama referred to Rizzo as "my fellow 44." Obama is the nation's 44th president.

Obama said it will be hard for him to wear the jersey, but told the Cubs: "Do know that among Sox fans I am the Cubs' No. 1 fan."

Hours after the Cubs won the series in November, Obama asked the team on Twitter if it wanted to visit the White House before his term ends Friday.

The World Series title was the first for the Cubs since 1908, and they won it by defeating the Cleveland Indians in seven games.