By Katie Knapp Schubert

OMAHA (Reuters) - Nebraska authorities mistakenly released more than 300 criminals from prison early and are trying to track the two dozen they want to put back in jail, state officials said on Friday.

Nebraska Governor Dave Heineman said 306 inmates were released before their time expired because corrections officials used a faulty formula to calculate time off for good behavior for sentences of prisoners with mandatory minimum terms.

"Obviously there was a mistake made," said Heineman, who said those responsible at the state's Department of Correctional Services will be held accountable. "The bad guys need to be locked up and they will be locked up."

The governor did not say when the prisoners were released.

His office said 257 of the inmates have been out of prison for longer than the time left on their sentences and have stayed out of trouble, so the state will leave them alone.

Others have died or been paroled, some are back in prison, and some qualify for a supervised release program. But warrants have been issued for 20 to 25 to return to custody.

The state has reviewed all mandatory minimum sentences imposed since 1995, when state law changed so that time off for good behavior did not apply until a mandatory minimum sentence was served.

Attorney General Jon Bruning said none of the released inmates were murderers and most were habitual criminals who received mandatory minimum sentences.

"They're certainly not great guys, but I don't want the public to be alarmed," Bruning said.

One of the inmates has filed a lawsuit against the state to prevent his recapture, according to the Omaha World-Herald.

(Reporting by Mary Wisniewski in Chicago and Katie Knapp Schubert in Omaha; Editing by Doina Chiacu)