The kingdom was a rump state that had been left after the collapse of the Lysimachian Empire. One of Lysimachus' lieutenants, Philetaerus, took control of the city in 282 BC. The later Attalids were descended from his father and expanded the city into a kingdom.
In 282 BC, Philetaerus deserted Lysimachus, offering himself and the important fortress of Pergamon, along with its treasury, to Seleucus I Nicator, who defeated and killed Lysimachus at the Battle of Corupedium in 281 BC. Seleucus was killed a few months later. Philetaerus, especially after the death of Seleucus, enjoyed considerable autonomy despite being nominally under the Seleucids. He acquired considerable wealth because Pergamon had been the treasure-hold of Lysimachus and extended his power and influence beyond Pergamon. He contributed troops, money and food to the city of Cyzicus, in Mysia, for its defence against the invading Gauls, thus gaining prestige and goodwill for him and his family. He reigned for forty years and built the temple of Demeter on the acropolis, the temple of Athena (Pergamon's patron deity), and Pergamon's first palace. He added considerably to the city's fortifications.
Eumenes I succeeded in 263 BC. He rebelled and defeated the Seleucid king Antiochus I Soter near the Lydian capital of Sardis in 261 BC. He freed Pergamon, and greatly increased its territories. He established garrisons, such as Philetaireia, in the north at the foot of Mount Ida, which was named after his adoptive father, and Attaleia, in the east, to the northeast of Thyatira near the sources of the river Lycus, which was named after his grandfather. He also extended his control to the south of the river Caïcus, reaching the Gulf of Cyme. He minted coins with the portrait of Philetaerus, who was still depicting the Seleucid king Seleucus I Nicator in his coins.
Pausanias wrote that the greatest achievement of Attalus I (reigned 241–197 BC) was his defeat of the Gauls, by which he meant the Galatians, Celts who had migrated to central Asia Minor and established themselves as a major military power. Several years later the Galatians attacked Pergamon with the help of Antiochus Hierax, who rebelled against his brother Seleucus II Callinicus, the king of the Seleucid Empire and wanted to seize Anatolia and make it his independent kingdom. Attalus defeated the Gauls and Antiochus in the battle of Aphrodisium and in a second battle in the east. He then fought Antiochus alone in a battle near Sardis and in the Battle of the Harpasus in Caria in 229 BC. Attalus won a decisive battle and Antiochus left to start a campaign in Mesopotamia. He gained control over Seleucid territories in Asia Minor north of the Taurus Mountains. He repulsed several attempts by Seleucus III Ceraunus, who had succeeded Seleucus II, to recover the lost territory.
In 223 Seleucus III crossed the Taurus, but was assassinated. Achaeus assumed control of the army. Antiochus III the Great then made him governor of Seleucid territories north of the Taurus. Within two years he recovered the lost territories and forced Attalus within the walls of Pergamon. However, he was accused of intending to revolt and to protect himself he proclaimed himself king.