Grobiņa Castle is a medieval castle located in the town of Grobiņa, in South Kurzeme Municipality in the Courland region of Latvia. The ancient Curonian castle hill (Skābāržu kalns) is located only 100 m from the castle. It is supposed to be the famous Seeburg, which is mentioned in Scandinavian sources as early as the 9th century.
 The Livonian Order erected the castle in 1253 to protect the roads from Livonia to Prussia. It was a square type building and was a three storey high living block in the  southern aisle. It also had a gate tower in the middle of the western wall. The castle was built of bricks and crude stone. Once it had arched ceilings. It was a residence for the local viceroy of the Livonian Order from 1399 to 1590. From 1590 to 1609 it was ruled by Prussia. As support base in south Courland it was many times rebuilt and fortified.
 In the times of the Duchy of Courland, the castle was destroyed and rebuilt many times. In the sixteenth and seventeenth century sand walls were erected around the castle. They had a bastion in each of the four corners and a stockade. Later the castle was used as a residence for local German landlords. The castle was destroyed in the eighteenth century.
Many famous people have visited the castle, for example: Duke Jacob Kettler of Courland, The King of Sweden, Carl XII and the King of Prussia, Friedrich Wilhelm III.
 The castle of the original order was built in the 13th century. The time and place of the construction of this castle are not clearly known, but several sources mention the period around 1245-1251 year, when under the leadership of the Master of the Order Dietrich von Grüningen, several castles were built in Kurzeme, including in Kuldiga Castle (Castle Goldingen) and Embūte Castle (Castle Amboten). The castle was made of wood.
 In 1328, the Livonian Order gave the Mēmele area to the State of the Teutonic Order. Probably soon after, Grobiņa Castle was rebuilt on the right bank of the river on a land elevation about 200 meters from castle mound (Skābāržkalns), and this stone castle was further ruled by the Grobiņa bailiff, who was under the command of Kuldīga. The castle was located on the ancient Prussian road, in the middle between Mēmele and Kuldīga, and was thus an important fortress in the region. It was a rectangular building with a three-storey residential building in the south wing and a gate tower in the middle of the west wall. In the 14th century, a soldier's passage stretched along the gutters around the fortified wall at the height of the second floor. Master Gosvin von Herike rebuilt and expanded the castle around 1347, as the seat of the bailiff (1399 - 1590) and the support point of the Order in South Kurzeme on the strategically important road to Prussia, it was strengthened and rebuilt several times.
 The last master of the Livonian Order, Gotthard Kettler, pledged Grobiņa Castle to the Duke of Prussia for 15,000 guilders during the Livonian War in 1560.  The pledge agreement was signed on May 5, 1560 in Reval (Tallinn), but the Duke's officials had left Grobiņa Castle as early as April 28–30.
 In July 1560, Master Johan Funks visited Grobiņa Castle, and a Protestant pastor had already preached in the church of the castle. Inventory list of the castle church in 1560:
 "Castle made of silverware - 1 silver cup, 1 square plate with a silver crucifix and two silver pictures, 1 silver ring, 1 gilded copper monstrance. Castle made of cast silver - 2 large chandeliers, 9 small chandeliers, as well as 1 pool for hand washing. or in the castle of the altar cloth - 1 old mass garment with crucifixes."
 In 1562, the castle manager, writer and servants stayed in Grobiņa Castle. In 1590, the arsenal arranged in Grobiņa Castle was mentioned for the first time.
 The fortress was fundamentally rebuilt and further strengthened in the 17th century. 
The bourgeoisie of Grobiņa was included in the Duchy of Courland and Semigallia in 1609, when the Duke of Courland Wilhelm Kettler married Duchess Sophie of Prussia. Grobiņa Castle became one of the dukes' residences, earthen ramparts with four bastions in the corners and a palisade fence were built around the castle.
During the Second Northern War in 1659, the Swedes burned down the town of Grobiņa and looted the castle. During the Great Northern War, the castle was again occupied and destroyed by the Swedish army under the command of King Charles XII of Sweden. Until the end of the Duchy of Courland and Semigallia, the castle housed the administrative institutions of Grobiņa Castle.
 In 1710, Frederick William, Duke of Courland married Anna Ioannovna (later Empress of Russia), but on his way back from St Petersburg, he took ill and died. Around this time in the duchy began the Great Northern War plague outbreak, which killed a large part of the population. Anne ruled as the duchess of Courland from 1711 to 1730. Economic and political significance of the castle greatly diminished.
 After 1809, the castle was no longer inhabited and gradually turned into ruins. Ulrich von Schlippenbach [de] wrote in 1809: "Although repairs were still possible a few years ago, [the castle] is no longer inhabited. It is gradually turning into ruins. The outer walls are still strong and good, and 10 to 12 years ago I found one habitable premises, as well as the remains of an old weapons depot."
 During this time, King Friedrich Wilhelm III of Prussia visited Grobiņa Castle, who had settled in Mēmelburg Castle in Memel due to Napoleon's Invasion of Russia. In the 19th century, a city park was established around the castle ruins.
 In the 1970s major conservation jobs were made in the castle, according to the project of architect I. Stukmanis. Today the castle ruins are in a quite good condition. Most of the walls are still standing in three story height. Today's castle is a major tourist attraction and also a place for local gatherings and concerts.
Until 2009, the fortress remained in the Liepāja District, after that in the Grobiņa Municipality. As of 2017 the archaeological assemblage, including the hill fort, has been on Latvia's Tentative World Heritage List.