By 1712, at age 36, Hamilton established a reputation in Chestertown, Maryland, with a lucrative law practice. That year, he traveled to London to gain prestige in his profession. On January 27, 1712, he joined Gray's Inn, one of London's four societies for barristers. Two weeks later on February 10, he was called before the English Bar. At the end of the year, during the winter of 1712/13, William Penn hired Hamilton in a "replevin" case against Berkeley Codd. Codd disputed some of Penn's rights under his grant from the Duke of York, who would later become King James II. This started the long and friendly relationship between Hamilton and the Penn family.