The town is first documented in the year 786 asWilla, a name which is thought to be ofRoman origin.Theduc de Villars crossed the Rhine here in October 1702 to fight theBattle of Friedlingen during theWar of the Spanish Succession. Weil was severely damaged as a result of the conflict.
Agriculture dominated local industry until the 19th century, when the city began to grow, aided by its favourable transport connections. A railway marshalling yard linking Weil am Rhein toBasel was built in 1913. Swiss textile factories were established in the Friedlingen quarter. 1934 saw the construction of a harbour on the Rhine.
After the Second World War the population again grew rapidly due to the influx ofrefugees andstateless persons. Between 1971 and 1975 the communities of Ötlingen, Haltingen and Märkt were incorporated and Weil am Rhein became a substantial town.
Since 2014, line 8 of theBasel tram system has extended across the border from Switzerland to terminate in Weil am Rhein.