Former director of public prosecutions (DPP) Sir Keir Starmer has raised the prospect of assisted dying becoming legal under a Labour government, insisting he will not “stand in the way” of a change to the law if elected as an MP this week.

Sir Keir, who served as the head of the Crown Prosecution Service (CPS) between 2008 and 2013, is standing to replace retired Labour stalwart Frank Dobson as MP for Holborn and St Pancras at Thursday’s general election.

As DPP, the 52-year-old barrister, tipped to rise quickly in an Ed Miliband government, notably issued legal guidance to clarify the rules on assisted dying having been prompted by a legal battle won by late right-to-die campaigner Debbie Purdy.

Sir Keir, of Kentish Town, listed six mitigating factors against prosecution for assisted dying but he insists it is now down to Parliament to make the decision on a change of law.

“I did my bit as DPP, it’s a matter for Parliament that needs to be resolved,” he said.

“I wouldn’t stand in the way of a change in the law but I would want to ensure there are flexible conditions to deal with complex situations.”

A recent poll by Populus of 5,000 adults found that 82 per cent want to give terminally ill, mentally competent people the legal option to end their lives.

Lord Falconer of Thoroton, the former lord chancellor, is also planning to bring back a bill to make assisted dying legal as soon as the new Parliament is formed in May.

His previous bill won two key votes in the Lords but ran out of time.

Sir Keir pointed to the case of Daniel James, a 23-year-old who travelled to Switzerland in 2008 to take his own life after being left severely paralysed in a rugby training accident, as an example of the need to have “flexibility” in any new law.

He made the decision not to prosecute Mr James’s parents, who took their son to the Dignitas clinic in Switzerland.

“I’d be wary of fixed conditions under any new law,” he said. “Daniel James was not terminally ill, his life expectancy was that of a normal male, but I wouldn’t want to be in a position where the law requires the prosecution of Mr James’s mother.”