Lawyers in Texas are fighting to save the life of a female prisoner scheduled to become the 500th person to be executed by the state since the death penalty was reinstated in America in 1976.

Barring a last-minute stay, Kimberly McCarthy, 52, will face lethal injection next Wednesday for the 1997 murder of her neighbour. Should the execution be carried out, she would be the 500th person put to death by Texas, a state that has shown more enthusiasm in modern times for capital punishment than any other.

The next seven days will be the culmination of an emotional and legal rollercoaster for McCarthy. This is her third appointment with the death chamber in the space of five months.

"She is a very spiritual person. She believes what's meant to be is meant to be, and it's all in God's hands," said Maurie Levin, McCarthy's legal counsel since January.

Now Levin has filed a new motion to stay execution with the Texas court of criminal appeals. The filing argues that McCarthy has suffered from two fundamental flaws that persistently crop up in death penalty cases.

"As it turns out, Kimberly McCarthy is an African American woman scheduled to be the 500th person to be executed in Texas. Her case raises two of the most typical issues in the administration of the death penalty: race discrimination and the quality of counsel," Levin told the Guardian.

Kimberly McCarthy Photograph: Texas Department of Criminal Justice/AP

At the heart of the habeus application is evidence compiled by Levin that the jury at McCarthy's original trial in 2002 was essentially rigged through blatant racial discrimination. The case was racially charged from the start as it involved an African American defendant – McCarthy, pictured – and a white victim, her 71-year-old neighbour Dorothy Booth.

Dallas County, the area around the city of Dallas, where the trial was held, is 69% white and 23% black. Yet among the 13 men and women selected to form McCarthy's jury, only one was black.

Out of an initial pool of 64 prospective jurors, only four non-whites made it through to the final selection. Of those four, three were ejected from the actual jury through peremptory strikes by prosecution lawyers.

McCarthy's application for a stay of execution alleges that prosecutors consciously set out to distort the racial composition of the jury as part of a culture of discrimination that stretches back to the days of southern segregation. The filing cites the case in 1938 where the African American president of a historically black college was thrown headfirst down the Dallas County courthouse steps after he objected to being excused from jury service.

In 1963, a Texas training manual instructed prosecutors not to "take Jews, negroes, dagos, Mexicans, or a member of any minority race on a jury, no matter how rich or how well educated". A similar manual published in 1986 carried the memorable advice that it was "not advisable to select potential jurors with multiple gold chains around their necks or those who appear to be 'free thinkers'."

The habeus application traces such discrimination through to the present day. In 2005, three years after McCarthy was convicted and put on death row by an overwhelmingly white jury, an investigation by the Dallas Morning News found that prosecutors were still excluding eligible blacks from juries at more than twice the rate of eligible whites.

The filing argues that McCarthy was tried within the context of this history and culture of racial discrimination. Two of the prosecutors from the district attorney's office who led the capital case against her were trained within such an environment, the habeus application states.

Levin has gone further. In a separate filing, she has asked the presiding judge of the Texas court of criminal appeals Sharon Keller, and another judge sitting on the court Micheal Keasler, to recuse themselves from the McCarthy case on the grounds that they also served as assistant district attorneys in the same Dallas County prosecutors' office where the culture of discriminatory jury selection allegedly existed.

In addition to the claim of racially-skewed jury selection, Levin also argues that McCarthy should be spared execution because she received poor legal counsel after she was sent to death row. A recent US supreme court ruling, Trevino V Thaler, requires Texas courts to consider appeals from prisoners facing execution where they claim to have received inadequate legal representation after they were convicted.

Levin points out that neither McCarthy's original defence lawyer at trial, nor her subsequent counsel after she was sent to death row, made any attempt to challenge the racially distorted composition of the jury. "The evidence of discrimination in the selection of the jury was there to be had, yet her counsel did very, very little to examine her case for constitutional errors."