PORTLAND, Maine — An Eliot man who has been behind bars at York County Jail since 2012 awaiting trial on charges he sexually assaulted his former girlfriend and tried to kill her was released Wednesday after his bail was reduced from $100,000 to $1,000.

Paul Olsen, 34, of Eliot went before Justice Nancy Mills, who granted his reduced bail a week after she disqualified the York County district attorney’s office from prosecuting the case against him, according to his attorney Amy Fairfield.

“It’s a very long and storied history,” Fairfield said Friday about why Olsen has been behind bars for 32 months and why the case has been transferred out of the county.

Olsen was arrested Sept. 19, 2012, and charged with attempted murder, burglary, gross sexual assault and reckless conduct in connection to an act of reported rape and attempted strangulation of his ex-girlfriend, while her two young children were home, the night before his arrest.

She told police he broke into her house at about 11:30 p.m., held her against her will, at one point was attempting to strangle her, then put a pillow over her face. During the evening, he allegedly sexually assaulted her before leaving the home at about 6 a.m., the woman, who now lives out of state, reported to police shortly after he left her home.

A manhunt ensued, and Olsen was captured the day after at a relative’s home in Warren, Maine.

The charges changed slightly by the time Olsen entered a plea in court, with the attempted murder charge downgraded to aggravated assault and the addition of other domestic violence charges. He pleaded not guilty to aggravated assault, gross sexual assault, burglary, domestic violence assault, domestic violence stalking, criminal threatening and criminal mischief and was being held in jail unable to post the $100,000 bail.

Olsen, through his attorney, negotiated a plea agreement with the York County district attorney’s office that was set to go before a judge on Jan. 3, 2013, but a snowstorm delayed the proceedings. Then the case was given to Assistant District Attorney Thomas Miscio, who decided to go to trial, Fairfield recalled.

Just before Olsen’s May 4 trial was to begin, Fairfield learned “some confidential information had made its way over to the prosecution” and filed a motion in York County Superior Court with Mills, who canceled the trial and issued an order removing the York County district attorney’s office from the case May 14, the defense attorney said.

The case has been moved to the Cumberland County district attorney’s office and District Attorney Stephanie Anderson is handling it, according to Tamara Getchell, business and communication coordinator for the Cumberland County DA.

Cumberland County Superior Court clerk Sally Bourget said “everything is under seal at this time,” but she was able to say Mills on Friday granted a motion for a temporary transfer of the case to Cumberland County.

“He didn’t know he was going to get out,” Fairfield said of Olsen, who was released Wednesday after two years and eight months behind bars awaiting trial. “He was elated, very thankful and overwhelmed.”

Olsen’s bail conditions include that he not have any contact with his ex-girlfriend or her children, that he must live with relatives in New Hampshire and not leave New England and that he abide by an 8 p.m. to 6 a.m. curfew. He also must undergo a psychological evaluation and have a domestic violence risk assessment done within 10 days of his release as another court-ordered condition.

His next court date is June 22, his attorney said.

BDN writer Stephen Betts contributed to this report.

To reach a sexual assault advocate, call the Statewide Sexual Assault Crisis and Support Line at 800-871-7741, TTY 888-458-5599. This free and confidential 24-hour service is accessible from anywhere in Maine. Calls are automatically routed to the closest sexual violence service provider.

If you or someone you know is experiencing domestic violence and would like to talk with an advocate, call 866-834-4357, TRS 800-787-3224. This free, confidential service is available 24/7 and is accessible from anywhere in Maine.