Stringer / REUTERS Marissa Alexander is shown in this file photo in a Duval County courtroom in Jacksonville, Florida, May 3, 2012 .

A woman who was sentenced to 20 years in prison after she fired a warning shot in a wall amid a dispute with her allegedly abusive husband will receive a new trial, a Florida appeals court has ordered.

The original judge in the case did not sufficiently instruct the jury handling the trial of Marissa Alexander, the First District Court of Appeal ruled Thursday.

Alexander, 32, has said that her husband, 36-year-old Rico Gray, had physically abused her in a dispute on Aug. 1, 2010.

She testified that she fled into a garage and got a gun, but was unable to leave the home because the garage door was stuck. She testified that she went back into the house, where Gray was with his two sons, and fired the shot.

The appeals court said Thursday that the judge was correct to bar Alexander from using the state's controversial "Stand Your Ground" law as a way to defend her discharge of the gun.

But, Judge James H. Daniel wrote in the ruling, "we remand for a new trial because the jury instructions on self-defense were erroneous."

"I'm absolutely ecstatic," said Michael Dowd, a New York lawyer who has defended domestic violence victims since the 1970s, and is representing Alexander pro bono.

Alexander's attorneys had claimed self-defense and cited Stand Your Ground, which gives people some protection from prosecution for using potentially deadly force in cases in which they feel their life is threatened.

But State Attorney Angela Corey argued that Stand Your Law did not apply because Alexander acted in anger. The judge agreed, saying that by returning to the house, she showed she was not in fear for her life.

Florida's Stand Your Ground law came under nationwide scrutiny during the Trayvon Martin case, when neighborhood watch volunteer George Zimmerman shot an unarmed teen and authorities waited weeks before charging him. Corey also handled the Zimmerman case.

Alexander had never been arrested before she fired the weapon. The judge at her trial said her conviction on three counts of aggravated assault with a deadly weapon carried a mandatory 20-year sentence under state law.

Faith Gay, Alexander’s attorney, told MSNBC’s Al Sharpton on Thursday evening that her client was “ecstatic” following the court’s ruling.

“She’s looking forward to seeing her family and her three children again soon,” Gay said.

A separate proceeding will determine whether Alexander can be released on bail pending the retrial.

The Associated Press and Reuters contributed to this report.