Nebraska has become the first US state to use the opioid fentanyl to carry out the death penalty.

Convicted criminal Carey Dean Moore, 60, who killed two cab drivers in 1979, was executed in the state's first lethal injection and first execution in 21 years.

Amid two lawsuits from drug companies to stay the execution, Moore had told his lawyers he wanted to be executed.

Fentanyl is a powerful narcotic drug at the heart of the US opioid crisis.

According to the Omaha World-Herald newspaper, the state used an untried drug cocktail of diazepam, fentanyl, cisatracurium and potassium chloride to execute Moore.

Moore was convicted of killing cab drivers Reuel Van Ness and Maynard Helgeland in August 1979. Both men were 47-year-old Korean war veterans.

He was pronounced dead approximately 23 minutes after the drugs were administered, the Washington Post reported.

German pharmaceutical company Fresenius Kabi attempted to halt the execution with a federal lawsuit filed last week.

The suit alleged that Nebraska had not legally obtained the potassium chloride, meant to stop Moore's heart, and the cisatracurium besylate, a muscle paralytic.

State officials denied the allegations.

In a court filing viewed by the Post, the Nebraska Attorney General's office said: "The people of Nebraska have chosen by a wide margin to retain capital punishment for Moore's crimes.

"Their government is prepared to carry out Moore's sentence and possesses the constitutional, lawfully-acquired means of doing so."

A federal judge rejected Fresenius Kabi's request to block the use of its drugs, and a circuit court denied an appeal.

Another pharmaceutical company, Sandoz, requested last week that Nebraska reveal who made the drugs it would use to execute Moore.

But a judge ruled he would not decide on the case until after the execution.

Just three years ago, Nebraska had abolished the death penalty. A year later, it was restored after 60% of voters supported it.

Nebraska is not the first state to consider using fentanyl in an execution - particularly as drug companies continue to resist their products being used for death sentences.

In July, Nevada was set to use fentanyl in a lethal injection until a lawsuit stalled the execution amid claims that the state illegitimately obtained one of the drugs it planned to use.

Scott Frakes, director of Nebraska's Department of Correctional Services noted in an affidavit that lethal substances "are difficult, if nearly impossible, to obtain" in many death penalty states.

But so far, the legal questions have not involved fentanyl, the opioid at the centre of America's opioid epidemic.

In the US, it is approved as an anaesthetic and for pain relief, but because of its high profit margin for traffickers, it has become a large part of the US opioid crisis.

The Center for Disease Control (CDC) reported that between 2015 and 2016, the rate of drug overdose deaths in the US involving synthetic opioids such as fentanyl had doubled.

"There's no particular reason why one would use fentanyl," said Robert Dunham, executive director of the nonprofit Death Penalty Information Center.

"No one has used it before, and we've had hundreds and hundreds of executions by injection. That suggests that the state is using fentanyl because it can get its hands on it," he told the Washington Post.

According to the Omaha World-Herald, Nebraska has 11 remaining prisoners on death row.

Before Moore, Nebraska's last execution was in 1997, using the electric chair.