In 1798, Merlin took part in the French invasion of Egypt, acting as an aide-de-camp to General Bonaparte. He fought at the battle of the Pyramids, the capture of Katieh (where he was provisionally promoted to Lieutenant), the sieges of Jaffa and Acre, and the battle of Abukir. He returned to France with his commander in 1799.