Gov. Jerry Brown discusses a proposal to reduce California's prison population, at a Capitol news conference in Sacramento, Calif., Tuesday, Aug. 27, 2013. (AP Photo/Rich Pedroncelli) California Gov. Jerry Brown (Rich Pedroncelli/ AP)

Undocumented immigrants will be able to get a driver’s license, but Californians won’t be able to buy certain kinds of firearms under two bills the state legislature sent to Gov. Jerry Brown (D) on its final day of the 2013 session.

The immigrants will be able to get a driver’s license when they show certain documentation to the state Department of Motor Vehicles, though the bill passed Thursday leaves it to the DMV to determine what those documents should be. The licenses will be marked as a driver’s privilege, legally distinct from a resident’s license but allowing a holder to drive.

“This bill will enable millions of people to get to work safely and legally. Hopefully, it will send a message to Washington that immigration reform is long past due,” Brown said in a statement after the measure passed.

Another bill passed Thursday would allow undocumented immigrants to obtain a law license.

Democrats, who hold a super-majority in both the California state Senate and the Assembly, also passed several gun control measures limiting sales of semiautomatic rifles with detachable magazines and requiring owners of semiautomatics with detachable magazines to register those weapons by next July.

The legislature also passed a bill to expand the number of crimes that would disqualify someone from owning a gun for 10 years. Being convicted of violent crimes already prohibits a resident from owning a weapon; the new measure would add several drug crimes to the list.

The final weeks of the legislative session were largely consumed by negotiations between Brown and state lawmakers over reforming the state’s crowded prisons. On Thursday, Brown signed a compromise package that is likely to result in thousands of inmates being released. The bill will require the state to ask a panel of federal judges to delay an order to reduce prison populations so that California can expand mental health and substance abuse programs, which could then take on added capacity.

California’s prisons are so crowded that the state has sent about 4,000 inmates to correctional facilities in other states, according to a report prepared for the state Senate. An additional 2,700 inmates are housed in community, city or county facilities around the state.