Fairfax County students took more Advanced Placement and International Baccalaureate classes this year and scored higher on the rigorous exams than the year before, according to school system data.

Superintendent Jack D. Dale attributed the rise in the number of students taking the advanced classes and the higher scores to the school system’s focus on gifted education in elementary and middle schools.

“The increases in AP and IB participation are the result of an emphasis on expanding access to advanced academic coursework to all students,” Dale said in a written statement.

“Differentiated and rigorous advanced academic instruction has resulted in AP and IB student performance that has remained relatively stable or increased while AP and IB enrollment continue to rise.”

Fairfax students took 35,659 AP tests in 2012, an increase of 5 percent from 2011. Similarly, the number of IB tests grew 13 percent to a total of 7,525 exams.

The percentage of Fairfax students scoring a 3 or higher — out of 5 — on an AP exam was 72 percent, an increase of three percentage points from 2011 to 2012. Across all ethnic groups, the number of exams scoring a 3 or higher increased about 9 percent. Each ethnic group saw improvement on the AP exams. Among black and Asian students, the number of exam results with a score of 3 or higher rose more than 14 percent.

High school students who score a 3 or higher on AP exams can earn course credits at most colleges and universities.

Students who took IB classes in Fairfax experienced the same trend. The overall number of exams that scored 4 or higher — out of 7 — grew about 10 percent from 2011 to 2012. Among black students, the number of high exam scores increased 23 percent, while among Asian students, the exams saw an increase of 11 percent.

The number of white students’ exams scoring highly increased 10 percent, and Hispanic students’ exams scoring highly increased 7 percent.

The percentage of total IB exams scoring a 4 or higher in 2012 decreased to 72 from 74 in 2011, which is partly reflective of an overall increase in the number of tests students took.

In 2012, about 73 percent of eligible students received an IB diploma by completing the advanced course requirements. At Marshall High School, more than 90 percent of the IB candidates received said diploma. In all, about 2,900 students in Fairfax took IB exams in 2012, a 26 percent increase since 2009.

More than 16,350 Fairfax students took AP tests in 2012, 10 percent more than just three years ago. Nearby Montgomery County, which landed on the AP District Honor Roll this year, had nearly 16,800 students take 32,970 AP exams, with 75 percent scoring a 3 or higher, placing the county near the top of national achievement lists.