ARLINGTON, Texas — Toronto left-hander Francisco Liriano was cleared to fly home with his teammates after taking a line drive near the back of his head in the Blue Jays’ 5-3 victory over Texas on Friday in Game 2 of the AL Division Series.

Liriano turned away from the hit by Carlos Gomez with one out in the eighth inning, and the ball ricocheted into right center off the back of his neck near his head. The hit was measured at 102 mph, and Gomez winced as he headed to first on the run-scoring single.

The 32-year-old pitcher stayed on his feet and walked around the infield briefly before his teammates, a trainer and manager John Gibbons came out to check on him. Liriano was replaced by closer Robert Osuna, who pitched for the first time since leaving the AL wild-card game three days earlier with shoulder discomfort.

An ambulance was waiting in the tunnel after the game to take Liriano to a hospital, where he was checked and then cleared to return to Toronto on the team flight that evening.

Liriano had stayed in the dugout briefly before going to the Toronto clubhouse. Gibbons said he wasn’t sure precisely where the ball struck Liriano.

“Anytime you get a head injury, you got to get it looked at. So that’s about the extent of it right now,” Gibbons said after the game before Liriano had gone to the hospital.

Gomez also wasn’t sure where the ball hit Liriano.

“It’s tough to see that, but it’s part of the game,” Gomez said.

Liriano was the winning pitcher in the wild-card game against Baltimore, throwing 1 2/3 scoreless innings before Edwin Encarnacion’s game-ending three-run homer in the 11th. He allowed two hits and two runs in 1/3 innings Friday.