The loss of his parliamentary seat enabled Erskine to concentrate on his legal practice. In 1786, when he was thirty-six years old and had been practising at the Bar for only eight years, he was able to write: "I continue highly successful in my profession, being now, I may say, as high as I can go at the Bar. The rest depends on politics, which at present are adverse." Amongst his notable cases in 1780s was his successful defence of William Davies Shipley, dean of St Asaph (and son of Jonathan Shipley) who was tried in 1784 at Shrewsbury for seditious libel for publishing Principles of Government, in a Dialogue between a Gentleman and a Farmer, a tract by his brother-in-law Sir William Jones advancing radical views on the relationship between subjects and the state. Erskine's defence anticipated the Libel Act 1792 (32 Geo. 3. c. 60), which laid down the principle that it is for the jury (who previously had only decided the question of publication) and not the judge to decide whether or not a publication is a libel.
In 1789 he was counsel for John Stockdale, a bookseller, who was charged with seditious libel in publishing John Logan's pamphlet in support of Warren Hastings, whose impeachment was then proceeding. Erskine's speech, which resulted in the Stockdale's acquittal, argued that a defendant should not be convicted if his composition, taken as a whole, did not go beyond a free and fair discussion, even if selected passages might be libellous. Henry Brougham considered this to be one of Erskine's finest speeches: "It is justly regarded, by all English lawyers, as a consummate specimen of the art of addressing a jury".
Three years later he would, against the advice of his friends, take on the defence of Thomas Paine who had been charged with seditious libel after the publication of the second part of his Rights of Man. Paine was tried in his absence; he was in France. Erskine argued for the right of a people to criticise, reform and change its government; he made the point that a free press produces security in the government. But in this case his arguments failed to convince the special jury, who returned a verdict of guilty without even retiring. Erskine's speech is also remembered for a passage on the duty of barristers to take on even unpopular cases: I will for ever, at all hazards, assert the dignity, independence, and integrity of the English Bar, without which impartial justice, the most valuable part of the English constitution, can have no existence. From the moment that any advocate can be permitted to say that he will or will not stand between the Crown and the subject arraigned in the court where he daily sits to practise, from that moment the liberties of England are at an end.
Erskine's decision to defend Paine cost him his position as attorney-general (legal advisor) to the Prince of Wales, to which he had been appointed in 1786.
In 1794 William Pitt's government, fearful of a revolution, decided to take action against people who were campaigning for parliamentary reform. Habeas corpus was suspended and twelve members of radical societies were imprisoned and charged with a variety of offences amounting to high treason. Erskine and Vicary Gibbs were assigned as counsel to seven of them. They were not paid for their services, as it was considered unprofessional to take fees for defending people charged with high treason. The treason trials began on 28 October before Lord Chief Justice Eyre at the Old Bailey with the trial of Thomas Hardy, a shoemaker and secretary of the London Corresponding Society. After eight days of evidence and speeches, including Erskine's seven-hour speech on the final day, and several hours deliberation, the jury returned a verdict of not guilty. Erskine was hailed as a hero by the crowds outside who unharnessed his horses (which he never saw again) and pulled his carriage through the streets. Although it was usual in cases where several people were jointly charged with high treason to discharge the rest if the first was acquitted, the government persisted with the trials of John Horne Tooke and John Thelwall. They too, defended by Erskine and Vicary Gibbs, were acquitted and it was only then that the prosecution was halted. A disappointed government had to scrap a further 800 warrants of arrest. In 1800, the owner of the Manor of Hartshorne, Derbyshire, William Bailey Cant, left it to Erskine, in recognition of his role in these cases.
Notable amongst the later cases of Erskine's career was that of James Hadfield, a former soldier who had fired a shot at the king in Drury Lane Theatre. The shot missed and Hadfield was charged with treason. Erskine called a large number of witnesses who testified to Hadfield's sometimes bizarre behaviour, a surgeon who testified to the nature of the head injuries that Hadfield had sustained in battle, and a doctor, Alexander Crichton, who gave evidence that Hadfield was insane. Erskine argued that, although Hadfield could appear rational, he was in the grip of a delusion and could not control his actions. He summed up: "I must convince you, not only that the unhappy prisoner was a lunatic, within my own definition of lunacy, but that the act in question was the immediate unqualified offspring of the disease". The judge, Lord Kenyon, was convinced by Erskine's evidence and argument and stopped the trial, acquitted Hadfield and ordered him to be detained. The trial led to two acts of parliament: the Criminal Lunatics Act 1800 which provided for the detention of people who were acquitted of a crime by reason of insanity, and the Treason Act 1800.