FOXBORO — The Bills drafted cornerback Stephon Gilmore 10th overall in 2012, and he went on to have five pretty good seasons in Buffalo, including one in which he was selected to the Pro Bowl.

The Patriots saw enough in the 6-foot-1, 202-pound Gilmore to do something they rarely do — open Robert Kraft’s vault and make a humongous withdrawal. The two parties agreed to a five-year, $65 million contract on the first day of free agency in 2017.

The easy-going and soft-spoken Gilmore got off to a rocky start in New England as he adjusted to the relentless demands of a no-nonsense organization where everything is done with the sole purpose of winning championships.

“You have to have a great mental toughness here,” Gilmore recently said at Gillette Stadium. “Mentally you have to be strong and be able to compete day in and day out and play with good technique. That’s what makes good players, day in and day out just trying to compete.”

Soon enough, Gilmore put his on-field issues behind him and trended up when it came to locking down receivers. He has taken another step — make that three or four — forward this season, in the process becoming one of the NFL’s elite cornerbacks.

That was acknowledged awards-wise as the seventh-year pro was selected to the Pro Bowl last month and named first-team All-Pro by the analytics website Pro Football Focus on Tuesday and The Associated Press on Friday.

While Gilmore is the one making the plays — his 20 passes defensed ranked second in the league this season — he credited position coach Josh Boyer for helping refine and augment his technique while making him understand what it really means to work hard.

Same goes for the rest of the cornerback contingent.

“A lot of stuff that I didn’t know before I got here I learned from him,” Gilmore said of Boyer, who’s in his 13th season in New England. “He’s made me a better player. His understanding of coaching technique and that playing hard for the team play in and play out can take you a long ways.

“He keeps coaching us hard and pushing us to get out of that comfort zone and go the extra mile and be better and better every day. So he’s a great coach, and he’d helped all of us out in our own ways.”

While the Patriots as a whole haven’t played their best football after Thanksgiving as traditionally has been the case under coach Bill Belichick, the cornerbacks displayed marked improvement over the final six games.

With the exception of a rough first half at Miami, the top trio of Gilmore, Jason McCourty and J.C. Jackson got the job done in wins over the New York Jets (twice), Minnesota Vikings and Buffalo Bills and in a losing effort at Pittsburgh.

What’s particularly impressive is McCourty has made a fairly smooth transition to the Patriots’ way of doing things after spending the previous nine seasons with Tennessee and Cleveland.

Same goes for Jackson, who went undrafted in April and will make his NFL playoff debut nine months later when the Patriots host an AFC divisional-round game at 1 p.m. next Sunday at Gillette Stadium.

Like Gilmore, McCourty lauded Boyer for not settling for anything but the best and the most from his position group.

Boyer will admonish his corners for not running hard enough to the ball on a backside play and when they don’t shed a blocker fast enough with the play in front of him.

“Every single thing we do, whether the ball is thrown to you or it’s a running play to the other side, his expectations for every guy in that room or so high and that’s the way he coaches,” McCourty said.

“I think those little things of just always being on me, even as an older guy it’s just motivated me to not be complacent at all. Making sure I give 100 percent on each and every play.”

That approach helped turn Gilmore into an All-Pro and, perhaps, will lead to a promotion — either here or elsewhere — in the near future for Boyer.

—Contact Rich Garven at rgarven@telegram.com. Follow him on Twitter @RichGarvenTG.