Lorimer was born in Aberdalgie in Perthshire. He was the son of James Lorimer, manager of the Earl of Kinnoul's estates. He was educated at the High School in Perth then studied Law at Edinburgh University, doing further postgraduate studies in Berlin, Bonn and Geneva, broadening his understanding of European Law.
He was admitted to the Faculty of Advocates in 1845. He purchased an impressive Georgian townhouse at 22 Queen Street, with James Jardine as a close neighbour. In 1861 he was elected a Fellow of the Royal Society of Edinburgh his proposer being Leonard Schmitz.
He became Regius Professor of Public Law at the University of Edinburgh in 1862, a post he retained until his death. The post had been vacant since the death of Prof Robert Hamilton in 1831. After gaining this post he moved to 21 Hill Street, close to Old College where he worked.
Lorimer first rented Kellie Castle in 1878 and it became the family home. His children included the painter John Henry Lorimer and the architect Sir Robert Lorimer.
In Edinburgh after retiral he moved to the suburb of Bruntsfield, living at 1 Bruntsfield Crescent.
He is buried in the extreme south-west corner of the very small and remote Newburn Churchyard in Fife with his wife and children.
A plaque in his memory is situated at the entrance to the Law Faculty at the University of Edinburgh.
Lorimer's publications include The Institutes of Law: a Treatise of the Principles of Jurisprudence as Determined by Nature (1872) and The Institutes of the Law of Nations: a Treatise of the Jural Relations of Separate Political Communities (two volumes, 1884).
His legal philosophy was one of Natural law that stood against the prevailing Legal positivism.
His concerns with the application of natural law to international relations were particularly influential in formalising the forms of inter-state recognition in 19th century continental Europe. In 1873 he was one of the founders of the Institut de Droit International.
Lorimer married Hannah Stodart (1835-1916) in 1851. She was only 16, he was 33.
Lorimer was the father of both the noted architect, Sir Robert Lorimer, and the famous painter, John Henry Lorimer. These sons are buried with him, together with their sister, Louise Lorimer (1860-1946).
Their eldest son James Lorimer (1852-1898) died in Grahamstown, South Africa.
Professor Lorimer's portrait, by J. H. Lawson, hangs in the main stair leading to the Playfair Library in Old College, University of Edinburgh.