Rogatec lies on the railway line from Grobelno (Slovenia) to Zabok (Croatia).
Rogatec was first attested in written records in 1130 as Roas (and as Rohats in 1192, Rohatsch in 1234, Rohathes in 1254, and Rohats in 1363). The name is derived from *Rogatьcь, based on the common noun rog in the geographical sense of 'tall rocky prominence' with possible extension to a hill, mountain, or creek associated with such a geographical feature. The German name of the settlement was Rohitsch. This and the early transcriptions of the name with h are direct evidence that the Slovene phonological change *g > γ once extended all the way to eastern Styria.
The history of Rogatec reaches back to the early Middle Ages. At the beginning of the 11th century it was one of the administrative centers of the estates of Friesach-Zeltschach. After the death of Hemma of Gurk in 1045, the estate she held in Rogatec passed to the ownership of Gurk Abbey in Carinthia, and then to the Bishopric of Gurk in 1072. Rogatec was mentioned in Wolfram von Eschenbach's early 13th-century German romance Parzival: Ûz Zilje ich für den Rôhas reit (From Celje, I rode to Rogatec; IX:498.21). Rogatec was a feudal possession belonging in turn to several noble families—Traungau, Rohitsch, and Žovnek (later the Counts of Celje)—and from 1456 onward to the Habsburgs. Rogatec was first mentioned as having market rights in 1283, and was mentioned as a town in 1377 and 1466 due to its walls, although it never officially held this status because its population was not large enough. Rogatec was burned three times between 1470 and 1486. A 1487 attack by the Hungarians devastated the settlement, leaving it in ruins and nearly deserted.
Rogatec was exposed Ottoman attack in the 16th century. Peasants were forced to repair the fortifications in 1530, and in 1551 an infantry company was stationed there. In 1550, Rogatec received the right to hold a fair every Wednesday, as well as three annual fairs. By 1789 this had grown to nine fairs per year. The market square burned twice during the 18th century. The town gates were still standing in 1782, and there was a pillory in the middle of the square. Most of the buildings in the historic center of the settlement were rebuilt in the 19th century, but they preserved the layout and height of the older structures.
After the invasion of Yugoslavia, the occupying forces exiled about 30 families from Rogatec, mostly intellectuals, to Croatia and Serbia. On the night of 29 March 1944, there was a successful Partisan raid on a German weapons depot in Rogatec.
Rogatec is the site of nine known mass graves associated with the Second World War. The Kutner Ravine Mass Grave (Slovene: Grobišče Kutnerjev greben) is located east of the town, between a ravine and a road, about 250 m from the Križan house in the hamlet of Ceste. It contains the remains of Hungarians and Ukrainians that were taken to a firing trench by German troops, where they were murdered. The Parking Lot Mass Grave (Grobišče na parkirišču) lies in the parking lot opposite the gas station in Rogatec south of the railroad tracks. It contains the remains of two prisoners of war that were bound, led to a willow, and shot by a Partisan on a horse in May 1945. The Rehar Corner Mass Grave (Grobišče Reharjev kot) is located in a meadow 4 m from a large walnut tree at the end of Counts of Celje Street (Poti Celjskih grofov). It contains the remains of four young men that were led to the site and shot on the night of 19 May 1945 and left lying in the meadow. The Strmol Mass Grave (Grobišče za Strmolom) lies about 110 m above Strmol Mansion. It contains the remains of a group of prisoners that were taken from the mansion after the war and murdered. The Strmol Park 1 and 2 graves (Grobišče v parku Strmol 1, 2) are located in the park below Strmol Mansion near a large chestnut tree. They contain the remains of two Yugoslav officers, a father and son, that were shot and buried here at the beginning of 1941. The Saint Bartholomew Mass Grave (Grobišče pri sv. Jerneju) lies inside the northwest wall around Saint Bartholomew's church. The remains of three people were discovered during excavation work at the site. The Špurn Chapel-Shrine Mass Grave (Grobišče Špurnova kapela) is located behind the hill above the town cemetery near a chapel-shrine. It contains the remains of several people, including two young men captured near the Sotla River and an Austrian soldier shot in May 1945. The Saint Hyacintha Mass Grave (Grobišče pri sv. Hiacinti) lies in a ravine behind Saint Hyacintha Mariscotti's Church. It contains the remains of 12 prisoners of war that were shot in May 1945.
The parish church in the town is dedicated to Saint Bartholomew (Slovene: sveti Jernej) and belongs to the Roman Catholic Diocese of Celje. It was first mentioned in written documents dating to 1363, but the current building was built between 1738 and 1743. A second church in the northern part of the town is dedicated to Saint Hyacintha Mariscotti and was built in the 1730s.The 15th-century manor house known as Strmol Mansion (Slovene: Dvorec Strmol) stands on a hill above the old town center of Rogatec.
The Rogatec Open Air Museum preserves the folk architectural heritage and cultural tradition of the Sotla Valley region between the 18th and 20th centuries. This central Styrian farm of the Subpannonian type presents local arts and crafts, traditions, and customs. Hands-on educational workshops include baking bread, weaving baskets from cornhusks, blacksmithing, and other traditional occupations.
Notable people that were born or lived in Rogatec include:Branko Hofman (1929–1991), poet
Blasius Kozenn (1821–1871), cartographer
Mihael Lendovšek (1844–1930), religious writer
Janez Jurij Mersi (1725–1788), poet and literary critic
Dragan Šanda (1881–1963), sculptor
Janko Šanda (1870–1927), poet and literary critic