The money will be awarded across four years in the Race to the Top-Early Learning Challenge.
Overall, $133 million in Race to the Top grants were awarded to five states.
Gov. Susana Martinez's administration said New Mexico will use its share of federal money to make sure that children are ready to learn when they start kindergarten.
The money will also be used to help improve reading skills of students from pre-kindergarten through third grade.
"The commitment to reform for our students has again made New Mexico a national education leader," Martinez said in a statement.
Hanna Skandera, secretary-designate of public education, said the grant for New Mexico was a "huge victory for our students and schools."
The state could start to receive the money in February.
Last year, New Mexico missed the grant when it received the 10th-highest score in a round where nine states received funding, said Larry Behrens, a spokesman for the state Public Education Department.
In addition to New Mexico, Colorado, Illinois, Oregon and Wisconsin will share in the grants announced Thursday.
Race to the Top began in 2011 when the federal government awarded $500 million to nine states to improve early childhood education programs.