Bastaam is a city in and capital of the Bastam District of Shahrud County, Semnan Province, Iran. Bastam was founded in the 6th century in the Greater Khorasan. It is 6 kilometres (3.7 mi) north of Shahrud. The town is known for its Islamic monuments from the Ilkhanid period and its association with the mystic Bayazid Bastami. The Alborz are to the north of the town.
The 19th-century poet, Abbas Foroughi Bastami, lived in Bastam for a time and thence acquired its name as his own. The early Bábí leader and martyr Mullá 'Alíy-i-Bastámí was also raised in Bastam, and was a significant figure in the Shaykhi movement and later became the first person known to have died for their allegiance to Bábism.
A tradition says that the town was founded by Vistahm, uncle of the Sasanian king Khosrau II.