NEW YORK — A California-based team of engineers snagged a $1 million NASA prize by winning a competition to fly homemade rockets on mock Moon landing missions.

Masten Space Systems of Mojave, Calif., successfully flew its rocket Xoie twice within a set time limit to qualify for the top Level 2 prize in the Northrop Grumman Lunar Lander Challenge, a NASA-sponsored contest to build mock lunar landers.

The Masten team beat longtime front-runner Armadillo Aerospace, a Texas-based team led by video game developer John Carmack, with precision flying on Oct. 30 that gave their Xoie vehicle the best landing accuracy of the multi-month competition. The prizes were awarded Nov. 5 at a ceremony is  in Washington.

The Lunar Lander Challenge is one of NASA’s Centennial Challenges that offer cash prizes for engineering feats. For the Lunar Lander Challenge, NASA offered a total of $2 million in awards for successful flights of vehicles capable of hopping from one launch pad to another.

Carmack’s Armadillo Aerospace won the $350,000 first-place prize for Level 1 of the competition in 2008, with the Masten team nabbing the $150,000 second-place purse earlier this month with a different rocket called Xombie.

Level 2 of the contest was trickier, but with a much larger payout. It also required a round-trip flight, but extended the flight to 180 seconds  and included a simulated moonscape for added difficulty.

Carmack and his team qualified for the $1 million prize in September using their Scorpius vehicle, which had an average landing accuracy of about 87 centimeters.

But it was Masten Space Systems, led by engineer David Masten, which took the top prize after pushing through a communications glitch, a pad fire and a truck stuck in the sand to take home top billing. During an extra day of competition, Masten’sXoie rocket flew twice with a landing accuracy of about 19 centimeters.

The competition was not without some controversy. A decision by contest judges to allow Masten Space Systems an extra day to try for the Level 2 prize  caused some consternation among the other teams.