The Castle of Noudar (Portuguese: Castelo de Noudar) is a Portuguese medieval castle in the civil parish and municipality of Barrancos, in the district of Beja.
 The settlement (sometimes referred to as Nodar or Noudall) was founded in 1167, but taken from the Moors by Gonçalo Mendes da Maia. Archaeological excavations revealed vestiges of human occupation in the place since the Calcolithic Age, that included the alcáçova and northern spaces. The area between keep tower and residential areas were not occupied during the period of Islamic occupation.
 On 6 December 1253, King D. Alfonso X of Castile (the Wise) conceded forals (charters) to Noudar, Arouche, Aracena, Moura and Serpa. He would eventually donate all these lands to his daughter D. Beatriz, whom he had marry the defeated King D. Afonso III after his invasion of Portugal. The marriage contract, bound the territory to Portugal, and the lands would be returned to their heirs. During D. Afonso X's battle with his successor, the prince D. Sancho, D. Beatriz placed the lands and forces under the disposal of her father's armies, but they were eventually defeated by partisans loyal to the Infant.
 Following the 1295 peace treaty between King D. Dinis and King D. Fernando IV (heir of D. Sancho), Noudar returned to the crown of Portugal. Quickly, on 16 December 1295, Denis signed a new foral for Noudar, but eventually he would donate the lands to the Order of Aviz (on 25 November 1307), this following his determination that the nuns and master D. Lourenço Afonso promoted the settlement of the region with the construction of a castle, wall and fortress. To further promote settlement along the frontier, on 16 January 1308, King Denis excepted the residences in the town from debts; conceded graces to the Masters of Avis (for their help with agriculture and for their support of vassals in the preceding fours years); and took from them crops of the Commendas of their order; and instituted a couto with royal protection for the next five years. A inscription stone was originally affixed to the tower keep (today missing, but referred to by Gustavo de Matos Sequeira) noted that D. Lourenço Afonso, master of the Order of Avis, was ordered by D. Dinis to found the castle and town of Noudar.
 Between 3 March 1307 and 11 April 1311, D. Aires Afonso occupied the position of Commander of the Order of Avis and promoted work on the castle (from an inscription located today in the municipal hall of Barrancos. On 26 April 1319, in a letter from D. Dinis to D. Gil Martins, master of the Order, the King nullified his debts for the construction of the castles of Noudar, Veiros and Alandroal. By 1322, the King donated castle to then-master D. Vasco Afonso, signeurial majorat of the town, in addition to land rents from the possessions of the churches of Serpa, Moura and Mourão, in order to facilitate the castle's construction.
 In 1339, D. Diego Fernandez, castilian noble of the Order of Santiago encircled the castle.
 During the course of the marriage between D. Fernando and D. Leonor Teles, in 1372, the castle was returned to Portugal. However, this only lasted until 1385, when it returned to the possession of Castile. Following the peace of the Treaty of Monção (in 1386), the lands and castles of Noudar, Mértola, Castelo Mendoand Castelo Melhor were exchanged for Olivença and Tui.
 In 1406, King D. John, with the objective of reinforcing the border settlement, he renewed the coute of the site.
 In Duarte d'Armas's Book of Fortresses the castle includes an irregular barbican, addorsed and partially integrated in the southeast to the village wall, was partially ruined and included rectangular towers with similarly damaged and partially-ruined merlons. The barbican had a double line of walls in the northeast and two rectangular towers in the southwest, covered in tile and integrated simultaneously to the castle (forming a trapezoid), two semi-cylindrical corbels in the southeast, a square tower in eastern corner, and another in the north, also in ruin. In the northwest, the rectangular, vaulted keep tower included a cistern, illuminated by arrow slits and pyramidal merlons. Alongside the tower is a double entrance to the military square, central, longitudinal patio with two cisterns, and various dependencies that comprised the alcazaba.
 In the 16th century, the parochial church, to the invocation of Nossa Senhora de Entre Ambas as Águas (Our Lady of Between Both Waters), evoking its position between the ravine of Murtéga and the Ardila River that embraced the east and west of the village.
 In a letter sent to King D. Manuel I by Manuel Velho, on 20 February 1510, overseer of the work on the Castles of Portel, Moura and Mourão, there was reference to the Castelo de Noudall. This led to a new foral issued on 17 October 1513, by King D. Manuel.
 The Livro das Terras das Ordes - Povoação de entre Tejo e Guadiana (1532), referred to the commandery of the village, which was the majorat of the Avis and the Marquess of Torres Novas, the alcalde Luís Dantas. The lands of Noudar were identified as a parish, with a circus that included of six residents. In the neighbourhood of the town was the village of Barrancos with 73 residents, of which there were nine widows, two clergymen and the rest "Castilian".
 On 29 November 1557, the eldest parish clergy, the licentiate Bartolomeu Rodrigues, presented himself to the parish, thereby becoming the oldest prior documented at the parish.
 By 1577, the command of Noudar and Barrancos was under the dominion of D. Jorge, Duke of Aveiro. However, by 17 April 1590, these privileges were transferred to the House of Linhares.
 By the 17th century, the town was occupied by 400 residents, a Misericórdia, hospital and three hermitages. During the Restoration Wars, and succession battles, the castle was heavily damages by competing forces. During this period of instability the commandery of Noudar and Barrancos passed to the House of Cadaval in 1610. In two cases, in 1644 and 1707, the castle was taken by Spanish troops. Following several years, the parochial church was dedicated to Nossa Senhora do Desterro (Our Lady of Exile) at the turn of the century, by the Prior of Avis. Yet, following the battles of the Restoration crisis, by 1740, there were just 200 residents living in Noudar. In 1769, the prior of the church was Friar Ignácio da Costa Inverno.
 Until the 18th century, the village was the seat of the municipality, but the preceding years of strife and depopulation resulted in the transfer of the administration to the neighbour town of Barrancos. A plan for the redesign of the military square of Noudar made in 1755 by Miguel Luiz Jacob, identified the location of a star-shaped redoubt that was projected to be constructed along the wall of São Gens, along southeast, which was never built. The plan included a curtain and defenses along the southeast and northeast of the circus, and redoubt protecting a corbel in the west. In the alcazaba was a keep tower, that served to store gunpowder, a warehouses in the southwest that was demolished, and barracks in the northwest which were in ruined. In successive years (1758 and 1795) there were drawings made of the military square by João António Infante, (military academy of the Provinde of the Alentejo) and Lourenço Homem da Cunha de Eça (respectively).
 In the 19th century, the town was abandoned by the population.
 In 1879, the property-owner of the Herdade da Coitadinha, José Bonifácio Garcia Barroso, presented a request to King D. Luís to have the Castle of Noudar (then in ruin) pass to the management of the Ministério da Fazenda (Finance Ministry), as part of process to have it sold-off in public auction. In 1893, it was sold to João Barroso Domingues, property-owner in Barrancos, but was later resold to José Augusto Fialho e Castro, farmer and property-owner from the same town. It was then passed on to his heir, Maria das Dores Blanco Fialho Garcia.
 In 1894, the Treaty of Contenda was signed.
 Writing in 1909, Gustavo de Matos Sequeira referred to two inscriptions located in the keep tower, one that was previously stored in the Herdade da Coitadinha.
 In order to reformulate the nationalist architecture, the DGEMN Direcção Geral dos Edifícios e Monumentos Nacionais (Directorate-General for Buildings and National Monuments) demolished the more recent walls, consolidated the older structures, and reconstructed the vaulted ceilings, while re-tiling the structure's roofs. In 1979, the walls were consolidated, but further work was need in the summer of 1981, with recuperation covering the walls in ruin, restoration of the chapel and archeological prospecting by Cláudio Torres in 1981 (the Campo Arqueológico de Métola).
 In the 1990s, the property-owner was Maria das Dores Blanco Fialho Garcia. However, on 25 June 1997, a promissory contract was signed to purchase the castle by José Augusto Fialho in the Câmara Municipal de Barrancos. It was sold to EDIA da Herdade da Coitadinha. In 2000, the municipal council and Centro de Formação Profissional da Indústria da Construção Civil e Obras Públicas do Sul (Centre for Professional Training for Southern Civil Construction and Public Works) with support from the DGMEN, and financed by the Fundo Social Europeu (European Social Fund) through the Leonardo da Vinci Program, established a training school within the castle, with equipment from France, Italy and Spain.
 Between 2000 and 2001, recuperation of the Monte da Coitadinha was initiated, under provisions of the project Parque da Natureza de Noudar (Nature Park of Noudar).
 However, on 20 August 2012, the castle was temporarily closed by the municipality, owing to the risk of landslides and falling rocks.
 The castle is situated in an isolated, rural landscape on the extreme western edge of the Herdade da Coitadinha, implanted on a schist platform, crowning a 275 metres (902 ft) hilltop. The hill lies between the Rio Ardila and the Ribeira da Múrtega, some 2 kilometres (1.2 mi) from their confluence, just .5 kilometres (0.31 mi) from the Spanish border, along a connection between Beja, Moura a Jerez de los Caballeros and Via da Prata, one of the more important roadways in western antiquity. Within the circus is the Church of Nossa Senhora do Desterro (Our Lady of Exile) and about 200 metres (660 ft) from the castle is the Atalaia da Forca.
 West of the castle is dominated by riparian vegetation, such as oleanders, while the landscape along the Spanish frontier is stripped of vegetation caused by the introduction of monocultures. In the Herdade, dominated by perennial Quercus and forests of Quercus rotundifolia and Quercus suber, there is an abundance of riparian and wild fauna, with a vast archaeological and ethnographic patrimony, highlighting several dolmens, Chalcolithic settlements, watermills and huts.
 The fortress comprises the circus of the ancient village of Noudar, to the southeast, and the vestiges of the southeastern and southern walls. The irregular plan is oriented longitudinally northwest to southeast, that integrates the trapezoidal castle wherein northwestern wall is located the keep tower. The battlements are encircled by Chemin de ronde and reinforced by 12 rectangular and square corbels, and broken by two gates: one in the east, and the other in the west, protected by small, rectangular tower. The southeastern wall of the castle is rammed earth reinforced by schist masonry. The rectangular, keep tower is 17.5 metres (57 ft) tall with two doors, one on the ground floor and another on the second floor of the northwest wall, accessed by exterior staircase. The roof covering is crowned by pyramidal merlons. In the interior of the tower is a cistern, in addition to two others in the castle square, where there are visible vestiges of murals in the dependences that comprise the old alcazaba.
 Two inscriptions were discovered in the keep tower. The first was a commemorative inscription for the construction of the castle of Noudar, sculpted into stone, in Gothic scribe, later registered by Gustavo de Matos Sequeira: 
 Another inscription commemorated the work on the castle during the commandery of D. Aires Afonso, inscribed on ashlar, that included a flourished, cross of the Order of Avis accompanied by two birds and two fruits, a scallop and old shield of Portugal, with the epigraphy was delimited above and the sides. The lower half was damaged, making it difficult to discern the writing. The 23.5 by 27 centimetres (9.3 in × 10.6 in) limestone epigraphy on 65.5 by 28 by 19 centimetres (25.8 in × 11.0 in × 7.5 in) base is inscribed in Gothic lettering:
 Both original inscriptions were eventually transferred to the Museu Municipal de Barrancos (Municipal Museum of Barrancos).