Optimus Prime used to have dual swords that could extend from his hands for melee combat.
History[]
"Darkness Rising, Part 4"[]
He used them to a devastating effect against an army of undead Terrorcons.
"Darkness Rising, Part 5"[]
He also used them against Megatron.
"Legacy"[]
Optimus later acquired the Star Saber which then served as his primary melee weapon.
"Rebellion"[]
When Optimus upgraded his body through the Forge of Solus Prime, he lost both of these swords, but gained new projectile weapons as replacements.