Liu Yu also had some relations with Liu Bang, the ancestor of Han Gaozu, who was the twenty-second grandson of Liu Jiao, the younger brother of Liu Bang of Han Gaozu, the Prince of Chuyuan. However, blood relations have long been estranged. His family followed the Jin royal family nandu in the early years, when he was born, his mother died of illness after childbirth, the family was very poor, his father was unable to raise him for a while planned to abandon him, fortunately because Liu Huaijing's mother reached out to help and raised Liu Yu, he was able to survive.

After Liu Yu grew up, he read very little, and could only make a living by doing hard work, and he once felt that he would have nothing to do in the future, and could only do nothing for a lifetime. Later, someone said to him, "You should be a hero in the future." It is because of this sentence that Liu Yu regained confidence. So Liu Yu joined the army and became a member of the Beifu Army. In 399 AD, Sun En's army rebelled against the Jin, the eight southeastern counties responded, the government and the opposition shook, the imperial court rushed to send Liu Gaozhi and Xie Yan to lead the army to suppress, Liu Yu transferred to Liu Prisonzhi's command as a member of the army, Sun En conquered Huijian County, killed Xie Yan, and prepared to take Liu Prisonzhi with a single blow, but was defeated by Liu Prisonzhi, because Liu Yu had meritorious service to send him to garrison a small city, the soldiers were not hundreds, Liu Prisonzhi rushed to the front every time in battle, played a leading role, Therefore, the soldiers under his command were the bravest batch in every battle, and because of this, Liu Yu was able to make meritorious achievements many times, once Sun En led his troops to attack Garlic Mountain, and was violently attacked by Liu Yubu, many of whom were killed, and this battle even more played Out Liu Yu's prestige, the imperial court appointed him as the general of Jianwu, Liu Yu led the army to pursue Sun En, defeated Sun En, forced him to flee to the south, and broke Sun En again in Haiyan, Sun En was forced to throw himself into the sea, and in the past few years of fighting with Sun En and other rebel armies, Liu Yu acted as a vanguard every time, every time he was able to defeat the enemy, his military ability slowly appeared, he not only fought bravely, he could charge into the battlefield, at the same time he was also resourceful, good at winning more with less, at that time many of the armies of the imperial court were like bandits, every time they went to a place, they would plunder the city and the people, only Liu Yu's army was different, his army was strictly disciplined, and never harassed the people. The reputation among the people is excellent.
In the case of fighting with Sun En and other rebel armies for many years, the Jin Dynasty's troops were consumed in large quantities, resulting in a lot of defensive emptiness, which gave Huan Xuan, who was entrenched in the upper reaches of the Yangtze River, an opportunity to take advantage of, in 402 AD, the Jin court sent a large general Sima Yuanxian to lead a large army to attack Huan Xuan, Huan Xuan also did not lag behind and also sent an army to confront Sima Yuanxian, but Huan Xuan because of his cultivation for many years, he was already a strong soldier, and the Jin court side was consumed a lot of troops to suppress the rebel army due to years of conquest, and the results were obvious. The Jin general Sima Yuanxian was killed, Huan Xuan attacked jiankang city, Liu Yujue surrendered to Huan Xuan, Liu Yu was quite famous in the Northern Province army, Huan Xuan did not dare to kill Liu Yu easily, so he also gave Liu Yu a position of joining the army. The following year, Sun En's brother-in-law Lu Xun raised an army again, Huan Xuan sent Liu Yu to fight, killed Lu Xun lost his armor and ran south, Liu Yu because of his merits and added officials to the knighthood, Huan Xuan's wife Liu Shi was good at knowing people, she repeatedly persuaded her husband Huan Xuan to get rid of Liu Yu, to Huan Xuan said that it was of great use to keep Liu Yu, and also needed Liu Yu to help me in the Northern Plains, he was a rare general, at the same time Huan Xuan was also disintegrating the Beifu army, killing many generals in the Northern Province, the Beifu army was almost destroyed, and Liu Yu was also united with the old department of the Beifu Army at this time. Look for the right opportunity to get rid of Huan Xuan. In 404 AD, Liu Yu, in the name of hunting, gathered thousands of people from the old army of Beifu, and in the Jingkou Uprising, they raised the banner of opposing Huan Xuan, and all over the place responded, Huan Xuan knew that after Liu Yu raised his troops, someone who was worried all day long told him that Liu Yu was weak and not afraid, Huan Xuan did not know Liu Yu's ability, but Huan Xuan still had to give it a go, and sent his fierce generals to lead an army to resist Liu Yu, but Huan Xuan's luck seemed to have run out, and his army had been defeated and retreated since he met Liu Yu, and the fierce generals were killed, until they reached Jiankang City. Huan Xuan was beheaded and Emperor An of the Eastern Jin Dynasty was restored to the throne at Jiangling, but the Huan Xuan family forces remained entrenched in Jingzhou, and it was not until the following year that the Huan clan's forces were expelled from Jingzhou, and Emperor An of the Eastern Jin Dynasty was welcomed back to health. Liu Yu was given the title of Duke of Yuzhang Commandery because of his meritorious service to the imperial family, and his power above the court also grew. Began to take charge of the government of the dynasty.
However, since the Eastern Jin Dynasty has been in a corner of the east, it has always been threatened by the north, although there are many people in the Eastern Jin Dynasty who have also been in the Northern Expedition, but all of them have ended in failure, in order to strengthen themselves, Liu Yu decided to send a northern expedition, his first goal was Southern Yan, the Southern Yan Emperor Murong Chao had been harassing the Eastern Jin Dynasty after he took the throne, Liu Yu in order to resist southern Yan, decided to lead a large army from Jiankang to northern expedition to southern Yan, all the way Liu Yu was a solid wall qingye, to prevent Southern Yan from cutting off his rear road, Southern Yan Murong Chao was too light enemy, Thinking that the situation of the Jin army entering Southern Yan was a small fight, Liu Yu basically did not encounter resistance after entering the border of Southern Yan, until Liu Yu led the army to quickly attack the capital of Southern Yan, Murong Chao realized that he began to send troops to resist Liu Yu, Liu Yu had already figured out the strength of Southern Yan, adopted the strategy of attacking the west with sound, went around to the back of the Yan army and attacked on both sides to tell the Southern Yan army that the Southern Yan army was defeated, Murong Chao saw that the situation was not right and sent people to later Qin to request rescue, although Later Qin sent troops to rescue, but blindly bluffing, Liu Yu did not think so, Bent on attacking Southern Yan, Liu Yu, with the help of southern Yan generals, made flying towers, punching cars and other siege equipment, strengthened the offensive and defensive capabilities, and soon under the onslaught of the Jin army, the southern Yan capital could not resist, the Southern Yan officials opened the city gate to surrender to Liu Yu, Murong Chao broke through with dozens of people, was pursued by the Jin army, southern Yan perished, Liu Yu killed three thousand people below the southern Yan xianbei noble prince on the grounds that the southern Yan capital had not been surrendered for a long time, Murong Chao was escorted to Jiankang, and was beheaded in the streets of Jiankang.
Since the establishment of the Eastern Jin Dynasty, the imperial court discipline is loose and disorderly, the doors of the magnates are annexed to each other, the people are displaced, after Liu Yu took power, he vigorously publicized new rules and regulations, strictly prohibited the clans from annexing each other, and Liu Yu wrote to the emperor, asking for light and thin endowments, so that the people can rest and recuperate, many times the people fish, cut firewood, all need to pay taxes, Liu Yu shangbiao ordered all prohibition, exemption, return the mountains to the people, return the land to the people, at that time the people's residence is not uniform, Liu Yu formulated new regulations, redivide the region, Let the people live in fixed areas. Subsequently, Liu Yu's power grew larger and larger, and the Jin imperial family could be said to exist in name only, Liu Yu alone controlled dozens of states, was also made the governor of most capitals, and was also actively preparing for the destruction of Houqin in 417 AD, eliminating several major threats in the north. Liu Yu's great military merits made Liu Yu's position in the imperial court so prominent that Liu Yu accepted the position of Xiangguo and was given the title of Duke of Song, and in 419 Liu Yu assigned Wang Shaozhi to kill Emperor An of Jin and install his brother Sima Dewen as Emperor Gong of Jin. In the same year, he was also knighted as the King of Song, and the following year, Liu Yu was proclaimed emperor of Jin, demoted Sima Dewen to the title of King of Lingling, and the Eastern Jin Dynasty fell, Liu Yu changed the name of the country to Song, and the history called the regime he established liu Song.
Liu Yu claimed to be empress, learned the lessons of the Jin Dynasty, strengthened the centralization of power, weakened local forces, in order to prevent the courtiers from rebelling, he ordered that all those who led troops out on the expedition should be distributed with the imperial court army, and the army should be returned to the imperial court. Liu Yu made great achievements in politics, curbing the merger of the door valve family, cracking down on the powerful landlord class, and alleviating class contradictions; at the same time, rectifying the rule of officials, important talents from the cold door, political clarity was once clear, economically light and thin, allowing the people to recuperate and vigorously develop production, but also attached great importance to education, improved the social atmosphere, innovated tactics in the military, and built a strong army. Under Liu Yu's rule, the Southern Song Dynasty once surpassed the north to become the most powerful dynasty in the whole of China at that time. It also laid the foundation for the later reign of Yuan Jia.