Porcuna was already settled in the late Neolithic. The fortified camp established in the 3rd millenary BC on the Los Alcores hill is the oldest known in the upper valley of Guadalquivir; it is made of circular huts surrounded by two concentric walls. A similar camp was located on the Albalate hill. The two camps were still active in the Age of Bronze (2nd millenary BC).
In the 7th-6th century BC, the Los Alcores hill was re-settled by the Iberians, who built rectangular houses arranged according to a regular pattern. After the Roman conquest, the town was renamed Obulco, as listed by Pliny, Ptolemy and Strabo. During the Roman Republic and the Empire, the town was of significance, minting its own coins. During the Civil War, Obulco took the party of Caesar against Pompey; Strabo reports that Cesar planned the decisive battle of Munda in Obulco.

During the Muslim period, the town, renamed Balkuna, was the capital of an iqlim (district). Conquered by King Ferdinand III the Saint, Porcuna was transfered to the Order of Calatrava, which established the commandery of Porcuna. The Order fortified the town, building towers, an alcázar and an octagonal donjon. In 1242, Alfonso X the Wise swapped Porcuna for Cabra with the Order of Calatrava. Incorporated to the Royal domain, Porcuna was granted to the Council of Jaén. Porcuna was transfered back in 1402 to the Order of Calatrava, which would rule it until the 19th century. Two out of the priories established by the Order in the 16th century in Andalusia were located in Porcuna (St. Benedict and St. Mary). The Order built in 1411 / 1435 the Boabdil's Tower, used to jail the last Moorish king of Granada, captured at the battle of Lucena.

The flag of Porcuna, adopted on 17 November 2010 by the Municipal Council and submitted on 29 November 2010 to the Directorate General of the Local Administration, is prescribed by a Resolution adopted on 3 December 2010 by the Directorate General of the Local Administration and published on 23 December 2010 in the official gazette of Andalusia, No. 249, p. 8 (text).
The flag is described as follows:

Flag: Panel in proportions 2:3. Quartered, 1. and 4. White, 2. An upper stripe of 1/6, dark olive green, and a lower stripe, of 5/6, purple, 3. An upper stripe of 5/6, dark olive green, and a lower stripe, of 1/6, purple. In the center, the municipal coat of arms.

The flag, designed by Juan Carlos Montoro Güeto and Begoña Estrella Anguita, was selected among 12 proposals submitted to a public contest. Cut and embroidered by Cortinas Alipén, the flag was officially presented on 26 March 2011 (photos).

The colours of the flag are related to the past, the present and the future of the town. According to the designers, white symbolizes "the past and present search and establishment of peace by the citizens of Porcuna".
"White is the integration of the different cultures of the world we live in. White is a symbol of the nobleness of the Ibero-Roman village of Ipolka, which developed an advanced civilisation, in connection with the Mediterranean cultures.". White is also the colour of the banner of the Order of Calatrava, which ruled Porcuna for 650 years.
Purple is "the reflect of the Mediterranean culture that could not exist without the Christian religion and of its influence on our way of life. Porcuna belonged to the Kingdom of Jaén." The Kingdom of Jaén used a purple banner said to have been granted by Ferdinand III; the Royal banner was indeed crimson, but turned purple when ageing.
Dark green reflects "the colour of the landscape, seen everywhere as the colour of the Mediterranean olive tree". Green symbolizes five centuries of Islamic culture, reflected in the scientific and technologic innovations proper to Bulkuna, part of Al-Andalus.
The colour specifications are:

The coat of arms of Porcuna is prescribed by Royal Decree No. 2,219, adopted on 23 July 1977 and published on 29 August 1977 in the Spanish official gazette, No. 206, p. 19,335 (text). This was confirmed by a Resolution adopted on 30 November 2004 by the Directorate General of the Local Administration and published on 20 December 2004 in the official gazette of Andalusia, No. 246, pp. 28,986-29,002 (text).
The "rehabilitated" coat of arms is described as follows:

Coat of arms: Quarterly, 1. Gules a sun or, 2. Azure a waning moon argent, 3. Or a Cross of Calatrava gules with two small chains hanging in base, 4. Argent a castle azure masoned sable. A bordure argent inscribed with "MUNICIPIO PONTIFICENSE OBULCO URBS VICTRIS NOBILIS" in letters sable. The shield surmounted by a Royal crown closed.

The date of adoption of the historical coat of arms of Porcuna is unknown; the arms were probably designed around 1228, when Ferdinand III granted a charter and the title of villa to the town. An anonymous chronicle dated c. 1625 describes the arms as follows:

The arms the town has always been using are divided by a Cross of Calatrava. The two lower quarters are charged with a castle and two chains [trabas), respectively. I believe this is a reference to the rule of the Order of Calatrava: cala means "a castle" in Arab, therefore Calatrava means "the castle of the chains". The two upper quarters are charged with a sun and a half moon, respectively. This does not mean that the pagans venerated the two stars, but rather that the town was for many years an inexpugnable border and rock, defending the sun of justice, which is God and the holy Christian faith, against Muhammad's perfidious sect, represented by the half moon that was its emblem.

This design was more or less confirmed by subsequent sources.
Méndez Silva (1675) gives a shorter but similar description: "The shield is divided by the Cross of Calatrava in four parts; in the two upper parts, the sun and the moon, beneath, a castle and two chains". Antonio de Moya (1756) is more prolix:

The shield is cantonned by the Cross of Calatrava; first, an image of the sun; second, a crescent; third, two chains; and fourth, a castle. The castle represents the fortress that defended the town when reconquered. The sun recalls the shining virtues of the saint king, its conqueror, and the moon represents the Order of Calatrava, which, in its early times, increased through its opposition to the African moons. The chains and the cross are the proper emblem of the Order.

Estrada (1768) provides a short description similar to Méndez Silva's. Espinalt (1787) introduces some variation in the description: "A quartered shield, first a sun, second, a moon, third the Cross of Calatrava, and fourth two chains and a castle". Arribas Soria y Velasco (1792) gives the same blazon, detailing the fourth quarter as "two stone columns linked by a chain in the background a castle". Piferrer (1860) presents a colour drawing of the arms, "Quartered, a sun, a moon, a Cross of Calatrava and a castle with two chains".

The oldest representation of the arms in the town is probably the shield placed in the main arch of the gate of Jesus church, probably dating from the main revamping of the church, performed in the middle of the 18th century. As on Piferrer's rendition, the moon is placed in the 1st quarter and represented waxing, instead of waning, The chains are depicted azure on gules, instead of gules on or. With minor variations, this coat of arms was used until redesigned in 1965 by Modesto Ruiz de Quero. It is shown on a panel of the sacristy of the parish church, on street lamps, and on official documents and festival's programs. The shield os oval and the Royal crown open lacks pearls between the florets, therefore looking like a Ducal coronet. One some versions, the moon is represented waxing instead of waning. The bordure is inscribed with "Municipio pontificense. Obulco ciudad vencedora y noble". During the Second Republic, a mural crown was substituted to the Royal crown open.

On 9 November 1942, the Municipal Council unanimously approved the request of "rehabilitation" of the historical arms of Porcuna. On 15 January 1942, the Royal Academy of History, seemingly unaware of the history of the town, proposed a simpler coat of arms, "Or a fortified town in chief the Cross of Calatrava. A bordure argent inscribed with 'Nobilisque victrix Obulco'. The shield surmounted by the classic Spanish coronet, as usual." The proposal was accepted on 11 March 1943 by the Municipal Council but never approved by the Spanish Government; accordingly, the municipality kept in use the old coat of arms.
The revamped design proposed in 1965 by Modesto Ruiz de Quero, in Spanish shape, with the full motto and surmounted by a Royal crown open, was not approved by the Spanish Government, either. The design was eventually approved on 25 June 1976 by the Royal Academy of Heraldry and prescribed by the aforementioned Royal Decree. The Royal crown open was not substituted by the Royal crown closed until 1992.

The application submitted by the Municipal Council in 1942 also included a proposal of flag, white with the proposed coat of arms. On 8 January 1943, the Royal Academy of History validated the design. However, there is little chance that Porcuna ever used a white banner, since white is also the colour of the flag of the Order of Calatrava.