Hernández was signed by the Philadelphia Phillies as a free agent in 1998 and was added to the Phillies 40-man roster prior to the 2005 season. At the time he owned the best slider in the organization, according to Baseball America.
From 2000 through 2006, Hernández posted a 34–36 record with a 3.45 ERA and 17 saves in 204 games at five different levels. In 2000, he was selected to the Gulf Coast League All-Star team. He then started 2007 with the Triple-A Ottawa Lynx, where he went 1-0 with a 1.74 and six saves before joining the Phillies in May as a replacement for injured Tom Gordon.