Former All-Star pitcher Esteban Loaiza was sentenced to three years in prison for cocaine possession Friday.

Loaiza pleaded guilty in August to possessing about 20 kilograms, or 44 pounds, of cocaine with intent to distribute. He was arrested in February 2018.

Prosecutors had sought a sentence of nearly five years, while Loaiza's attorney had pushed for 18 to 24 months before U.S. District Judge Janis Sammartino issued her sentence in San Diego federal court.

Loaiza will be deported after serving his sentence, his lawyer said.

Speaking in court, Loaiza apologized "to my family, friends, my fans" and the sport of baseball. Sammartino said Loaiza had "accepted responsibility, which is the right thing to do."

Loaiza, 47, was under surveillance when he was arrested over a year ago near a house in Imperial Beach, which borders Tijuana, Mexico. His SUV had just left the garage when authorities confronted him.

After a canine sniffed drugs in the SUV, authorities obtained a search warrant for the house and found the cocaine in 20 packages in the compartment of another vehicle parked in the garage. Loaiza admitted in a plea agreement that he transferred the drugs from one vehicle to the other.

Loaiza was born in Mexico but attended high school in Imperial Beach. He played for several major league teams between 1995 and 2008, including the Pittsburgh Pirates, New York Yankees, Los Angeles Dodgers and Chicago White Sox.

He had a 21-9 record with the White Sox in 2003, finishing second in Cy Young voting and starting in the All-Star Game that year.

The Associated Press contributed to this report.