Hernandez made his major league debut July 15, 2002, with Kansas City Royals. His encouraging rookie campaign manifested itself in a 4-4 record with a 4.36 ERA in 74⅓ innings of work over 12 starts.
Initially thought of as the right-handed ace of the 2003 Royals team that posted the franchise's first winning record in nine seasons, Hernandez became the opening-day pitcher by winning Royals' manager Tony Peña's coin toss against left-hander Jeremy Affeldt. After spending the first five weeks on the leaderboard in almost every pitching category, Hernandez faltered as he tried to pitch through pain, and his season ended after 16 starts. He finished the season with a 7-5 record, but missed the entire 2004 season with Tommy John surgery.
On July 17, 2005, Hernandez ignited a bench-clearing brawl by hitting Detroit Tigers shortstop Carlos Guillén in the head to lead off the sixth inning. The two continued to exchange words down the first base line, and Hernandez threw down his glove and went after Guillén. In all, seven players were ejected, most notably Kyle Farnsworth, who tackled Jeremy Affeldt to reignite the situation that had been settling down. Later in his Royals career, Hernandez got into a scuffle with batterymate John Buck.
On August 26, 2006, Hernandez pitched his first complete game shutout against the Toronto Blue Jays. The win was made even more special because he defeated Roy Halladay, one of the best pitchers in the game.
Hernandez was released by the Royals on December 7, 2006, and signed to a minor-league contract by the Boston Red Sox on December 22, 2006. The contract he signed with the Red Sox included an opt-out clause that would become effective if he was not on the Major League roster by June 1. On that date, he exercised that option and was released. On June 5, he signed a minor league contract with the New York Yankees. He was released a month later on July 6. On July 17, he signed a minor league contract with the Pittsburgh Pirates, but would be released less than a month later.
On January 17, 2008, Hernandez signed a minor league contract with the Houston Astros. In September of that year, Hernandez, 25-36 for career in majors, received a 50 day suspension for testing positive for an amphetamine-based substance. However, the Office of the Commissioner of Major League Baseball announced on Friday, October 17, 2008 that it had withdrawn the suspension of the former Astros’ starting pitcher because it was a first offense. The Commissioner’s Office also issued a brief statement to clarify that Hernandez’s June 12, 2008 positive test for an amphetamine based substance under the Minor League Drug Prevention Program “shall not constitute a violation”, and that Hernandez would not be subject to disciplinary action.
On December 22, 2008, Hernandez signed with the Samsung Lions in South Korea's Korean Baseball Organization, but he sought and was issued his release on July 9, 2009.