Gov. Robert F. McDonnell signed into law Thursday a bill that will require Virginia high school students to take at least one virtual course to graduate with a standard or advanced diploma.

The new requirement will apply to students who enter ninth grade in 2013-14, said Charles Pyle, spokesman for the Virginia Department of Education. Current high school students are not affected.

Expanding virtual education has been a key part of McDonnell’s education agenda since taking office in 2010.

The online-course requirement will better prepare students for the “job market of the 21st century,” McDonnell spokesman Jeff Caldwell said via e-mail.

Virginia joins several other states, including Idaho and Florida, that have adopted online-course graduation requirements in recent years.

The new law also requires candidates for a standard diploma to earn a credential in career and technical education, such as an industry certification or state license.