Administratively, the municipality is divided into 3 civil parishes (freguesias):Nossa Senhora da Expectação
Nossa Senhora da Graça dos Degolados
São João Baptista
Campo Maior was certainly a Roman settling - the ancient Muro Dam is close by - which was under control of the Moors for half a millennium. In 1219, it was conquered by Christian knights, the Pérez de Badajoz family, who then granted the village, which belonged to the municipality of Badajoz, to the Church of Santa Maria do Castelo (Saint Mary of the Castle).
On May 31, 1255, King Alfonso X of Castile promoted the village to town status.
In 1260, Bishop Friar Pedro Pérez, the Town Lord, granted the first charter (foral) to the inhabitants of Campo Maior. He also introduced the town's first coat-of-arms, showing Our Lady and a lamb, with a legend "Sigillum Capituli Pacensis".
On May 31, 1297, the Treaty of Alcanizes was signed by King Ferdinand IV of Castile and King Denis of Portugal, whereby Campo Maior, together with Olivença and Ouguela, was transferred to the Kingdom of Portugal.
Under Portuguese sovereignty, Campo Maior went through an additional two Town Lords - Branca, sister of King Denis, in 1301, and Afonso Sanches, natural son of King Denis, in 1312 - before returning to King Denis's direct rule in 1318.
The castle east of the village was rebuilt by King Denis in 1310. In the 17th and 18th Centuries, other fortifications were built and Campo Maior became an important garrison town.
As a reflex of the influence of Castile in Campo Maior, the population and the garrison sided with Castile following the 1383–1385 Crisis. King John I of Portugal and Constable Nuno Álvares Pereira led their armies to Campo and besieged the town for six weeks, finally occupying it at the end of 1388.
King John II (1481–1495) granted a new coat-of-arms to Campo Maior: a white shield, with the Arms of Portugal on one side, and John the Baptist, patron saint of the town, on the other side.
In 1512, King Manuel I renewed the charter (foral) of Campo Maior.
From the late 15th Century, many of those persecuted by the Inquisition in Castile took refuge in Portugal. Many of them settled in Campo Maior, which saw its population increase substantially. As a consequence, in the 16th Century, the town's New Christian community was so numerous that it provided most of the accused of Judaism which were included in the Portuguese Inquisition's Auto-de-fé that took place in nearby Évora.
The war with Spain in 1640 brought major changes to the fortress. The need to re-fortify the town, which had grown markedly outside the medieval perimeter during the previous three centuries, and the urgency to build a new fortified perimeter to defend the inhabitants of the "new town" from the incursions of the Castilian armies, forced the Kings of Portugal to invest large amounts of money, and to send contingents of military engineers, specialized workers and even more non-specialized workers to strength Campo's defenses. Due to these efforts, the garrison substantially grew in size. It is estimated that, in late 17th Century, one out of four inhabitants of Campo Maior was employed by the military. Campo Maior was became the headquarters of the mercenary Dutch troops that fought in Alentejo. The town was at that time the second most important garrison in the Alentejo region, second only to the city of Elvas.
In 1712, during the Spanish War of Succession, the Castle of Campo Maior was besieged by the Spanish Army, commanded by the French Alexandre Maître, Marquis de Bay. For 36 days, he launched tons of projectiles on the town and managed to breach one of the bastions before attempting to storm the fortress. Upon crossing the breach, the Spanish Army suffered heavy casualties and retreated in defeat.
On September 16, 1732, at 3 am, a storm hit the Armory, located in the Castle's main tower, which stored 6000 arrobas of gunpowder and 5000 pieces of ammunition. A violent explosion ensued, followed by a fire. This event caused signifgant damage to the fortress and injured two thirds of the inhabitants of the fort.
King John V ordered the quick reconstruction of the Castle. The town slowly rose from the ruins and will eventually regained its main role both in times of war and in times of peace, and it became a trading post.
In the 18th Century, the Church of Misericórdia (Mercy) and the Matriz Church (Matrix, seat of the Parish) were built and the Church of Saint John was started. The town, which until then had been formed by a single freguesia (parish), was divided in 1766 into the present two - Our Lady of Expectação and Saint John the Baptist.
The early 19th century was devastating for Campo Maior: first by a siege in 1801 by the Spanish during the War of the Oranges, and then by a local rebellion in 1808 against the French who were engaged in the Peninsular War.
The uprising of Campo Maior against the Napoleonic invasion was successful due to the help from the Badajoz army, which then garrisoned the town for three years.
In 1811, a new Napoleonic invasion besieged the town for one month until Campo was forced into capitulation. This month gave time for the Anglo-Portuguese Army, under the command of British General Beresford, to arrive and rout the French. The town then earned the title of Vila Leal e Valorosa (Loyal and Valorous Town), now inscribed in its coat-of-arms.
The Liberal Wars (1828–1834) were also fought in Campo Maior area.
In 1836, the neighbouring municipality of Ouguela was annexed by Campo Maior, increasing its number of freguesias (parishes) from three to four.
In 1865, an epidemic of cholera killed 150 people in two and a half months.
In 1867, an attempt to extinguish the municipality of Campo Maior and integrate it in the municipality of Elvas provoked a popular uprising, with the population staging a strike on December 13. The attempt was dropped and the municipality survived.
In 1926, a fourth rural freguesia (parish) is added to the municipality: Our Lady of the Graça dos Degolados (Grace of the Beheaded).
In 1941, the municipality assumes its current division in three freguesias (parishes), with the annexation of the freguesia of Ouguela by the freguesia of Saint John the Baptist, due to the former's rapid population decline.
The main industry is coffee roasting and coffee packaging. Campo Maior is headquarters to Delta Cafés, the market leader of coffee distribution in Portugal.
Other economic activities include agriculture and livestock rising. Campo Maior is a production center of olives and ham, made from Iberian pig (also known as porco alentejano).