After his father's death in 1787, Dalhousie joined the British Army in July 1788 by purchasing a cornetcy in the 3rd Dragoons, and was later appointed to the captaincy of an independent company he himself had raised. He joined the 2nd battalion of the 1st Foot in January 1791, and purchased the rank of major in the 2nd Foot in June 1792. He travelled with the regiment to Martinique, as its commander, and succeeded to the lieutenant-colonelcy in August 1794. He was severely wounded in 1795 and returned to Britain. In 1798 he served in the Irish Rebellion, and in 1799 throughout the Flanders campaign. He received the brevet rank of colonel in January 1800, and fought in the later stages of the Egyptian campaign under Ralph Abercromby, capturing Rosetta without a fight and successfully investing the nearby Fort Julien in April 1801. In 1803 he served as a brigadier-general on the staff in Scotland, and was appointed Major-General in April 1805.