Khachmaz is a city in Northeastern Azerbaijan's Khachmaz region. It is located about 10 km from the Caspian Sea, below Khudat, and to the east of Quba. Khachmaz is 170 kilometres north of the capital Baku. The Khachmaz rayon borders the Republic of Dagestan of the Russian Federation.
The most northeastern region of Azerbaijan, Xaçmaz (or Khachmaz/Khachmas) is sandwiched between the Caucasus Mountains in Quba and Qusar
(Gusar), regions to the west, and the Caspian Sea to the east. The southern border greets Devechi and the region stretches north to Russia. Khachmas city is located toward the bottom third of the region. It is about 10 km from the Caspian Sea and the border to Devechi. About half that distance to the Quba border to Khachmaz's west. It is substantially greater distance to the northern border.
Modern historians believe that the name Khachmaz derives from khachmataki tribe of Huns, which transformed into Khacmaz in the middle of 7th century. It is also interesting, that part of the tribe in the second middle of the 7th century migrated to the territory of the current Oghuz district having constructed the settlement and naming Khachmar fortress.Khachmaz is considered a popular tourist destination, especially due to the Nabran municipality. The combination of a warm summer climate, woods along the seashore and clean golden beaches was exploited by the construction of large numbers of hotels and apartments in Khacmaz.Khachmaz district located in the north-west of the country covers the most part of Samur –Davachi lowlands and in the north borders the Russian Federation. Besides Khachmaz city the district includes Khudat city, Yalama settlement, Nabran tourist area and some dozens of villages.More than 60 monuments of history and culture are preserved in the district.