PHOENIX — Dozens of young immigrants protected from deportation under an Obama administration policy lined up outside government offices Monday in Arizona to apply for driver's licenses, a privilege first denied by the state but now given to them by the courts.

Monday marked the first day they could get licenses after a judge barred enforcement of Gov. Jan Brewer's policy of denying licenses to about 20,000 immigrants living in the country illegally.

Young immigrants waited outside a Motor Vehicle Division office in west Phoenix an hour before it opened. A cheer erupted when the office's doors opened.

They said they were excited to finally get the chance to drive legally. Many said they had been driving to their jobs for years without licenses and feared being pulled over.

Young immigrants have said the governor's policy made it difficult or impossible for them to get essential things done in their everyday lives, such as going to school, work or the store.

State officials are expecting a rush of immigrant applicants in the weeks ahead.

The move in Arizona to deny the licenses was a reaction to steps taken by the Obama administration in 2012 to shield thousands of immigrants from deportation.

The president's policy applied to people younger than 30 who came to the U.S. before turning 16; have been in the country for at least five continuous years; are enrolled in or have graduated from a high school or equivalent program; or have served in the military.

In the nation's most visible challenge to Obama's deferred-action program, Brewer issued an executive order in August 2012 directing state agencies to deny driver's licenses and other public benefits to immigrants who get work authorization under the policy.

Her attorneys have argued that the decision grew out of liability concerns and the desire to reduce the risk of the licenses being used to improperly access public benefits.

Despite her belief that issuing licenses is a state matter, Brewer's office confirmed she would comply with the court's orders.

Transportation officials said they will start processing applications for driver's licenses and identification cards from qualified immigrants.

Nebraska is the only other state to have made similar denials, and a federal judge this year dismissed a lawsuit contesting that state's policy.

The governor is asking the U.S. Supreme Court to review her appeal.