A former Philadelphia church official is due back in court two days after he was released from prison when his child-endangerment conviction was overturned.

Monsignor William Lynn has served all but three months of his three-year sentence since his high-profile 2012 trial.

But Philadelphia District Attorney Seth Williams insists he will retry the case. A judge could set a trial date at the Thursday morning hearing.

Lynn is the first church official ever charged or convicted over his handling of complaints that priests were molesting children.

The conviction has twice been overturned, most recently when the state's top court said the trial judge let too many church victims not directly linked to the case testify.

Lynn is free on bail and living with relatives.