Hamilton was the fourth son of Lord Archibald Hamilton, governor of Jamaica. He served in the army from 1747 to 1758 but left it after his marriage in that year to the Welsh heiress Catherine Barlow, daughter of the MP Hugh Barlow.
Hamilton was English ambassador to the court of Naples from 1764 to 1800. During this time he studied local volcanic activity and earthquakes, and wrote a book on the ancient Roman city of Pompeii. He collected Greek vases and other antiquities, selling part of his collection to the British Museum in 1772. His second collection went down with the ship that was transporting them to England in 1798.
His other books include Antiquites etrusques, greques et romaines (1766–67) and Mount Vesuvius (1772).
After Catherine's death Hamilton married Emma Lyon in 1791. She became Emma Hamilton, famous as the lover of Horatio Nelson.