The Air Force will pay more than $500,000 to an Ocean County elementary school that was mistakenly shot by an F-16 on a training maneuver two years ago.

Under a settlement announced Wednesday, the Air Force will pay $519,070 in compensation to the Little Egg Harbor Intermediate School. The building was damaged by 27 rounds of inert 20mm ammunition from an air cannon mounted on the plane during a Nov. 3, 2004 nighttime mission over the New Jersey Pinelands.

The military blamed the pilot for the accident, but also said poorly designed controls in the F-16 played a role.

"The Air Force has done the right thing," said state Rep. Jim Saxton. "Their agreement goes a long way towards repairing the actual damages to the school building as well as keeping their relationship with the community healthy."

School officials did not immediately return a call seeking comment Wednesday.

No one was injured in the mishap, which rattled the southern Ocean County region surrounding the Warren Grove Gunnery Range. Eight of the 2-inch lead rounds punched through the school's roof, knocking down ceiling tiles.

At least one round struck a child's desk, and others scuffed the asphalt in the parking lot. The rounds explode on impact when they are live.