Longwy is a commune in the Meurthe-et-Moselle department in north-eastern France. The inhabitants are known as Longoviciens.
Longwy initially belonged to Lotharingia. After the division of that kingdom, the town became part of Upper Lorraine and ultimately the Duchy of Bar. Longwy was ceded to the Duke Wenceslaus I of Luxembourg in 1368, but was returned to Bar in 1378. The Duchy of Bar was then annexed into the Duchy of Lorraine in 1480.
From 1648–1660 Longwy was part of the Kingdom of France, returning to the Duchy of Lorraine afterwards. It was made part of France again in 1670, a situation which was finalized in the Treaties of Nijmegen in 1678. Vauban fortified the town during the reign of King Louis XIV of France.
After the French defeat in the Franco-Prussian War of 1870-1871, almost all of the Moselle department, along with Alsace and portions of the Meurthe and Vosges departments, was ceded to the German Empire by the Treaty of Frankfurt on the ground that the population in those areas spoke German dialects. Only one-fifth of Moselle was spared annexation. Bismarck later bitterly regretted his decision when it was discovered that the region of Briey and Longwy was rich with iron ore.
The Luxembourgish painter Jean-Baptiste Fresez (1800–1867) was born in Longwy.
In 2008, the ville neuve ("New Town"), was listed as a UNESCO World Heritage Site, as part of the "Fortifications of Vauban" group.