Loaiza was arrested in Feb. 2018. Authorities obtained a search warrant to enter his home in Imperial Beach, a town bordering Tijuana, Mexico.
Loaiza was sentenced on Friday by U.S. District Judge Janis Sammartino in San Diego federal court. He will be deported back to his native Mexico, according to Loaiza's lawyer.
The two-time All-Star pitched for eight teams in his 14-year career. Loaiza tallied 126 wins, retiring in 2008 with a 4.65 ERA. His best season came in 2002, when he led the American League with 207 strikeouts en route to a second-place finish in the AL Cy Young vote.