He at once preferred a claim to the rights of an emperor in the city, which claim was decisively rejected; but in 850 he was crowned joint emperor at Rome by Pope Leo IV, and soon afterwards married his cousin, Engelberga, a daughter of King Louis the German, and undertook the independent government of Italy. He took the field against the Saracens; quashed some accusations against Pope Leo; held a diet at Pavia; and on the death of his father in September 855 became sole emperor.
The division of Lothair's dominions, by which he obtained no territory outside Italy, aroused his discontent, and in 857 he allied himself with Louis the German against his own brother Lothair, King of Lotharingia, and King Charles the Bald. But after Louis had secured the election of Pope Nicholas I in 858, he became reconciled with his brother, and received some lands south of the Jura mountains in return for assistance given to Lothair in his efforts to obtain a divorce from his wife, Teutberga.
In 863, on the death of his brother Charles, Louis received the kingdom of Provence, and in 864 came into collision with Pope Nicholas I over his brother's divorce. The archbishops, who had been deposed by Nicholas for proclaiming this marriage invalid, obtained the support of the emperor, who reached Rome with an army in February 864; but, having been seized with fever, he made peace with the pope and left the city.
In his efforts to restore order in Italy, Louis met with considerable success both against the turbulent princes of the peninsula and against the Saracens who were ravaging southern Italy. In 866 he routed these invaders, but could not follow up his successes owing to the lack of a fleet. So in 869 he made an alliance with the eastern emperor, Basil I, who sent him some ships to assist in the capture of Ban, the headquarters of the Saracens, which succumbed in 871.
Meanwhile his brother Lothair had died in 869, and owing to his detention in southern Italy, Louis failed to prevent the partition of Lotharingia between Louis the German and Charles the Bald. Some jealousy between Louis and Basil followed the victory at Ban, and in reply to an insult from the eastern emperor Louis attempted to justify his right to the title "emperor of the Romans." He had withdrawn into Benevento to prepare for a further campaign when he was treacherously attacked in his palace, robbed and imprisoned by Adeichis, prince of Benevento, in August 871. The landing of fresh bands of Saracens compelled Adeichis to release his prisoner a month later, and Louis was forced to swear he would take no revenge for this injury, nor ever enter Benevento with an army. Returning to Rome, he was released from his oath, and was crowned a second time as emperor by Pope Adrian II on May 18, 872.
Then Louis won further successes against the Saracens, who were driven from Capua, but the attempts of the emperor to punish Adelchis were not very successful. Returning to northern Italy, he died, somewhere in the province of Brescia, on August 12, 875, and was buried in the church of St Ambrose at Milan, having named as his successor in Italy his cousin Carloman, son of Louis the German.
Louis was an excellent ruler, of whom it was said "in his time there was great peace, because every one could enjoy his own possessions".