Ryan Miller arrived in Buffalo as a rail-thin college kid who could handle pucks but not his emotions. He’s leaving as a mellowed, married man who cemented his place in Sabres lore with records, fans and trophies, though not the one he wanted most.

Miller’s 12-season run in the Sabres’ organization came to an end Friday as Buffalo traded him to St. Louis along with Steve Ott for goaltender Jaroslav Halak, forwards Chris Stewart and William Carrier, a first-round pick in 2015 and a conditional pick.

Miller, who stepped into the crease in 2002 and has been the face of the franchise since 2007, departed as the team leader in victories and games played among goaltenders. He’s 16th in NHL history for most appearances with one franchise.

Miller always had the talent to reach those lofty heights, but there was a time it didn’t seem possible. His ability to mesh his on-ice abilities with a proper off-ice attitude is what put him ahead of everyone but Dominik Hasek on the Sabres’ goaltending chart. Among the most cerebral athletes ever to call Buffalo home, he matured into a world-renowned goalie who gave back to the community.

The fans loved him back. Even more eye-popping than his stats, which included 284 victories in 540 games, were the number of people who donned a jersey bearing the Miller nameplate. His No. 30 could be seen in every section of First Niagara Center and in countless establishments throughout Western New York. He connected with fans of all ages in ways that most players can’t.

While Miller’s dozen seasons in Buffalo weren’t always the best, they certainly were memorable.

Miller, selected in the fifth round of the 1999 draft, joined the Sabres in 2002 as the most accomplished netminder in NCAA history. During his three seasons at Michigan State, he went 73-19-12 with a 1.54 goals-against average, .941 save percentage and 26 shutouts. His shutout and save percentage totals remain NCAA records. He won the 2001 Hobey Baker Award as the best player in college hockey during his sophomore season.

The struggling, soon-to-be-bankrupt Sabres hoped Miller could establish himself in the NHL immediately in 2002-03, but the 22-year-old failed to elevate from the No. 3 spot in the dysfunctional triumvirate that also featured Martin Biron and Mika Noronen. He played just 15 games.

The next season was his bleakest. He was the opening-day starter in 2003-04 but went to the minors after losing the first two games. The Michigan native got another chance two months later against Detroit, but his home-state Red Wings tore him up with five third-period goals in a 7-2 loss. Miller responded with a two-sentence statement through a quivering voice and was sent to Rochester for the rest of the season.

In an odd twist, one of Miller’s biggest breaks came from the NHL lockout that wiped out the 2004-05 season. With nothing to worry about other than the Rochester Americans, Miller went 41-17-4 to lead the Amerks to the best record in the AHL. He matured and bonded with teammates Thomas Vanek, Jason Pominville and Derek Roy, who would soon join him for long runs with the Sabres.

It took 21 months for Miller to return to Buffalo following his meltdown against Detroit, but the time away served him well. He opened the 2005-06 season with a 6-2 record and inserted himself into the conversations for the 2006 U.S. Olympic team. A broken thumb suffered in early November derailed his chances, but he grew into a fan favorite upon his return.

Buffalo backers chanted, “USA, USA,” for Miller every time another American goaltender entered the Sabres’ arena. Miller usually emerged victorious, going on a 19-4-2 run as the young Sabres stunned the NHL by finishing fifth overall with a 52-24-6 record.

Western New York fell in love with the team as it advanced to Game Seven of the Eastern Conference finals. The adoration continued in 2006-07 as Buffalo began the season with 10 straight victories to tie an NHL record. Miller won eight times during the streak.

Buffalo fans flooded the ballot boxes to elect Miller, Brian Campbell and Daniel Briere as starters for the All-Star Game. Miller paid the people back by establishing The Steadfast Foundation, which donates time and money to Roswell Park Cancer Institute and Carly’s Club.

Miller backstopped the Sabres to the Presidents’ Trophy as the best regular-season team, and the Sabres again advanced to the Eastern Conference finals. The loss to Ottawa was only one major setback. The departure of Briere and Chris Drury was the other.

With the co-captains gone, the Sabres made Miller the face of the franchise. He made a franchise-record 76 appearances in 2007-08. His numbers suffered and Buffalo failed to make the playoffs, but the organization followed up with a five-year, $31.25 million contract to make Miller one of the highest-paid goalies in the league.

He had just one objective.

“We really need to be defined by something bigger, and we want it to be a legacy of a championship,” Miller said.

It never happened.

He started the 2008-09 campaign well, going 7-1-1, and had the Sabres in playoff contention in February until getting knocked down by the Rangers’ Scott Gomez. He missed 13 games with an ankle sprain, and Buffalo missed the postseason.

The 2009-10 season elevated Miller from NHL star to winter sports icon. During the Vezina Trophy-winning season, he established himself as the go-to guy for Team USA. He dominated the 2010 Vancouver Olympics, leading the young American squad to a silver medal while being named the most outstanding player of the tournament. As folks clamored to learn all they could about the international star, word got out that he was dating Hollywood actress Noureen DeWulf (whom he married in 2011).

He returned to a hero’s welcome in Buffalo, where he led the Sabres to the Northeast Division title with a 41-18-8 record, 2.22. GAA and .929 save percentage. The success failed to carry over into the postseason as Boston eliminated Buffalo in six games.

The Sabres lost in the first round in 2011, as well, and they haven’t made the playoffs since.

A 12th-place finish last season was the opening act for Miller’s departure. The fans booed goals and mockingly cheered easy stops for Miller, who put his downtown home up for sale. All was forgiven in the season finale as Miller played his 500th game, a 2-1 victory that seemed like a perfect going-away present for the cheering crowd and appreciative goaltender.

An anticipated trade failed to materialize in the offseason, and Miller again represented the United States at the Olympics as a member of the Sabres. He earned a 5-1 victory over Slovenia in his only appearance.

He got back to Buffalo this week, but he’s off to St. Louis now. The 33-year-old left an impressive legacy behind.