Gostivar's surroudings and the city as well has been populated since the ancient period. According to many sources about Gostivar, it is known that the entire area of Upper Polog was in the borders of Ancient Macedonia.
A settlement with the name Gostivar in the written documents, is mentioned for the first time in 1313 AD as a larger settlement in the southern part of the Polog plain with approximetly 200 inhabitants.
This city has flourished at the end of the 19th century, when it has became a regional centre, during the Ottoman authority. It was this period when Gostivar turned from a small settlement to a little town. The Gostivar bazzar was formed, after the immigration of different merchants and craftsmen from Veles, Kruševo, Kičevo and Debar, while tuesday was specified for a market day, which is a tradition even today.
During the period of the Ilinden rebelion, many rebels and patriots from Gostivar and the surroundings will take part and fight in Kruševo.
During the Second World War, the Macedonian population of Gostivar will experience a outrageous terror from the Albanian faschist leaders - the Balists lead by the Dzemo and Mefail. Exactly at the end of the war Dzemo will be killed near Gostivar, an event that has lead to a local celebration of the Macedonians from Gostivar. Gostivar has its national hero from this war, Čede Filipovski - Dame, whose monument is located at the main square. Many Partisan detachments and units have been active agains the Albanian Balists, during the Second World War in Gostivar and its surroundings.
Gostivar in the newer history of Macedonia was remebered after the action of the Macedonian police for removing the national flag of a foreign country (in this case - Albanian).