A judge has claimed he was put under "improper and undue influence" to keep a defendant in custody.
Judge Keith Raynor refused to extend the time a teenager charged with drugs offences could be held in custody before his trial.
Woolwich Crown Court heard Tesfa Young-Williams was charged with serious drug offences last October and had been in custody for 321 days because of delays.
That is 139 days beyond the custody time limit (CTL), the judge said.
Refusing the further extension on Tuesday, Judge Raynor ruled government measures which include the creation of 10 Nightingale courts - temporary courts to help tackle the number of outstanding cases - were slow, not proportionate, lacked funding and that alternative, adequately-funded measures which would have worked were not adopted.
In a highly unusual move, Judge Raynor has made public communications with a senior judge in the lead-up to Mr Young-Williams' CTL hearing.
Judge Raynor said he felt "pressurised into granting the CTL extension application" and "was subjected to improper and undue influence to make a ruling extending the CTL in the case of R v Tesfa Young-Williams".
The judge has now been told he will not be hearing a CTL application in another case but has said he wants to issue a formal complaint.
Custody limits are in the spotlight because the Covid pandemic has led to an increased backlog of cases causing more defendants on remand awaiting trial to have their custody limits extended.
Since lockdown began in March, the backlog of crown court cases has risen by 6,000 to 43,000.
The government has announced it will extend CTLs from six to eight months from the end of September. It also expects to have 250 usable jury trial rooms by November, as part of a so-called "criminal courts recovery plan".
'Real constitutional concern'
The Ministry of Justice has pledged an extra 1,600 court staff and £80m towards a range of measures, including more Nightingale courts.
Concerns have been raised that the distance between the senior judiciary and ministers is becoming too close.
Criminal barrister Kirsty Brimelow QC said: "The judiciary and the government are separate and distinct, so where there is a closeness between senior judiciary and government on policy, as there is here on custody time limits, there is real constitutional concern that this may compromise the independence of the judiciary."
Judge Raynor's actions are exceptional and the senior judge he has criticised has said it would not be appropriate to comment.
However, the allegations put the relationship between senior judges and the government firmly under scrutiny.