NASCAR Cup Series qualifying from Michigan International Speedway is in the books, and it's Denny Hamlin who has claimed the pole ahead of Sunday's Firekeepers Casino 400.

The Joe Gibbs Racing star set the fastest time of Saturday evening's session with a 39.901-second effort on the very final lap, just enough to edge Carson Hocevar and deny the driver of the No. 77 a home-race pole.

It also marks Hamlin's 50th career pole in the Cup Series, with the 45-year-old joining a short list of legends to have earned both 50 wins and 50 poles in the top level of the sport.

Elsewhere at Michigan, Tyler Reddick qualified in third and will start Sunday's race on the second row, with Ty Gibbs alongside him in the No. 54. Chase Briscoe, a fourth Toyota, rounded out the top five.

Chase Elliott, meanwhile, qualified in sixth, with Kyle Larson, Christopher Bell, William Byron and Erik Jones rounding out the top 10 in that order.

Further down the order, it was a tougher day for some big stars. Bubba Wallace was only good enough for 13th, while Joey Logano and Ryan Blaney were only 18th and 19th fastest, respectively.

Josh Berry was the only driver not to set a lap time during the session after spinning during his qualifying effort.

NASCAR Today: Denny Hamlin reveals why he's retiring as two penalties confirmed after Nashville

NASCAR Cup Series Michigan qualifying results

Here are the full qualifying results from Michigan International Speedway.

NASCAR Cup Series Michigan qualifying results
Pos Driver (Car No.) Team (OEM) Time / Gap
1Denny Hamlin (11)Joe Gibbs Racing (Toyota)36.901s
2Carson Hocevar (77)Spire Motorsports (Chevrolet)+0.018s
3Tyler Reddick (45)23XI Racing (Toyota)+0.028s
4Ty Gibbs (54)Joe Gibbs Racing (Toyota)+0.052s
5Chase Briscoe (19)Joe Gibbs Racing (Toyota)+0.055s
6Chase Elliott (9)Hendrick Motorsports (Chevrolet)+0.057s
7Kyle Larson (5)Hendrick Motorsports (Chevrolet)+0.066s
8Christopher Bell (20)Joe Gibbs Racing (Toyota)+0.102s
9William Byron (24)Hendrick Motorsports (Chevrolet)+0.137s
10Erik Jones (43)Legacy Motor Club (Toyota)+0.189s
11Daniel Suarez (7)Trackhouse Racing (Chevrolet)+0.220s
12Riley Herbst (35)23XI Racing (Toyota)+0.226s
13Bubba Wallace (23)23XI Racing (Toyota)+0.232s
14Chris Buescher (17)RFK Racing (Ford)+0.285s
15Cole Custer (41)Haas Factory Team (Chevrolet)+0.304s
16Zane Smith (38)Front Row Motorsports (Ford)+0.312s
17John H. Nemechek (42)Legacy Motor Club (Toyota)+0.339s
18Joey Logano (22)Team Penske (Ford)+0.356s
19Ryan Blaney (12)Team Penske (Ford)+0.357s
20Michael McDowell (71)Spire Motorsports (Chevrolet)+0.376s
21Austin Dillon (3)Richard Childress Racing (Chevrolet)+0.376s
22Noah Gragson (4)Front Row Motorsports (Ford)+0.440s
23Ricky Stenhouse Jr. (47)HYAK Motorsports (Chevrolet)+0.441s
24Ty Dillon (10)Kaulig Racing (Chevrolet)+0.507s
25AJ Allmendinger (16)Kaulig Racing (Chevrolet)+0.556s
26Brad Keselowski (6)RFK Racing (Ford)+0.575s
27Ryan Preece (60)RFK Racing (Ford)+0.650s
28Austin Hill (33)Richard Childress Racing (Chevrolet)+0.652s
29Alex Bowman (48)Hendrick Motorsports (Chevrolet)+0.660s
30Shane van Gisbergen (97)Trackhouse Racing (Chevrolet)+0.661s
31Austin Cindric (2)Team Penske (Ford)+0.766s
32Ross Chastain (1)Trackhouse Racing (Chevrolet)+0.789s
33Cody Ware (51)Rick Ware Racing (Chevrolet)+0.814s
34Connor Zilisch (88)Trackhouse Racing (Chevrolet)+0.819s
35Todd Gilliland (34)Front Row Motorsports (Ford)+0.829s
36JJ Yeley (44)NY Racing Team (Chevrolet)+1.669s
37Josh Berry (21)Wood Brothers Racing (Ford)No Time

READ MORE: Kyle Busch's wife Samantha shares heartfelt and emotional statement following NASCAR legend's death