A French anaesthetist has been accused of giving patients lethal injections to trigger heart attacks in order to pose as a hero for bringing them back to life.

Sometimes he failed and seven people died as a result, prosecutors claim.

Investigating magistrates have linked Dr Frédéric Péchier to the “poisoning” of 24 patients, aged four to 80, between 2008 and 2016 at two clinics in the eastern city of Besançon, where he practised.

On Friday, Péchier, who has denied all the allegations, was freed on conditional release after appealing against a ruling that he should be held in custody until his trial. His defence team said the decision showed “wisdom, moderation and objectivity”.

Péchier, 47, has been accused of injecting patients with potassium chloride or other anaesthetics during routine operations. He was officially put under investigation in 2017 for seven poisonings; a further 17 cases were added during a court hearing on Thursday.

The public prosecutor, Etienne Manteaux, had called for the doctor to be held in custody. Manteaux said investigators had looked into more than 66 “serious undesirable events”, namely suspicious cardiac arrests during low-risk operations. But he admitted there was only circumstantial evidence against Péchier.

French health authorities consider a “serious undesirable event” one that was “unexpected given the state of health and pathology of the patient” and has serious consequences, including death.

Manteaux said the accused appeared to be the “common denominator” for the alleged poisonings. He added investigators found Péchier was “often in the immediate proximity” of the patients involved while making “an early diagnosis … at a stage when nothing led to suspicions of an overdose of potassium or local anaesthetics”.

The four-year-old, a boy named only as Teddy, suffered a cardiac arrest twice during an operation to remove his tonsils in February 2016. He was resuscitated by Péchier.

“The charges rest on a series of concordant elements,” Manteaux said. He added that Péchier was “omnipresent” in handling the resuscitation of patients after heart failures and the doctor’s colleagues found he was suspiciously fast in diagnosing anaesthetic overdoses, the prosecutor said.

The incidents were more numerous during periods of “intense conflict” between Péchier and his colleagues, Manteaux said.

Péchier’s lawyer Randall Schwerdorffer said his client “rejects all the charges brought against him”.

“We challenge anybody to show us any evidence,” Schwerdorffer said.

After Thursday’s hearing, another of Péchier’s lawyers, Jean-Yves Le Borgne, told reporters his client’s involvement in the alleged poisonings was “nothing but a hypothesis”.

Frédéric Berna, lawyer for the patients and their families, told reporters there was clear evidence of poisoning in seven cases. “That’s already a strange coincidence,” Berna said. “If the other cases are proven it will be even harder to believe,” Berna told TF1 television.

He added: “Do you realise that all these people, including children, went into hospital to be cared for? Some never came out, others live with, in some cases, serious consequences.”