His family was from Tong Prefecture (同州, in modern Weinan, Shaanxi), but his father Yan Shi (嚴實) had served as an assistant to a Tang dynasty director for Yangtze River-Huai River shipping, and therefore settled at the future Wu capital Guangling (廣陵, in modern Yangzhou, Jiangsu), which was then the capital of Tang's Huainan Circuit (淮南).
It was said that Yan Keqiu was intelligent and capable of strategies in his youth, and became a guest of the Huainan officer Xu Wen, then serving under Huinan's military governor (Jiedushi) Yang Xingmi.
[3] Even though Yan Keqiu was directly serving under Yang Xingmi, he remained closely allied with Xu Wen.
At the meeting, he stated to Yan that he was waiting for the arrival of his oldest son Yang Wo, who was then serving as the governor (觀察使, Guanchashi) of Xuan Prefecture (宣州, i.e., the capital of Ningguo Circuit) and that he had directed his key advisor Zhou Yin (周隱) to issue an order summoning Yang Wo.
Yang Wo, along with several other regional warlords, refused to recognize the Later Liang emperor and continued to use the Tang era name of Tianyou, but by this point was effectively the ruler of his own domain, then known as Hongnong (as he carried the title of Prince of Hongnong) and later known as Wu (as Yang Xingmi carried the title of Prince of Wu).
)[7] Zhang, however, maintained control over the Hongnong governance, and soon made Xu the governor of Zhexi Circuit (浙西, headquartered at Run Prefecture).
[8] Wei's defeat left one semi-independent warlord in the Zhennan region — Lu Guangchou, who controlled the region around Qian Prefecture (虔州, in modern Ganzhou, Jiangxi), who, like Wei previously, was nominally submitting to both Hongnong (which became named Wu in 910 when Yang Longyan claimed the title of Prince of Wu that his father carried) and Later Liang.
Early that year, the officers Ma Qian (馬謙) and Li Qiu (李球) seized Yang Longyan one night and intended to attack Xu Zhixun.
[9] In 918, Wu finally launched an operation to capture Qian Prefecture and the surrounding region, which by that point was controlled by Lu Guangchou's old associate Tan Quanbo, with the general Wang Qi (王祺) in command.
Prior to the attack's being launched, Yan hired engineers to open up the Gan River rapids at Ganshi (贛石, in modern Ji'an), allowing the Ganshi rapids to be navigated by the Wu fleet and allowing the Wu attack to quickly reach Qian Prefecture.
Xu Zhixun therefore wanted to eject Zhu from Guangling by making him the military governor of a new Jinghuai Circuit (靜淮, headquartered in modern Huai'an, Jiangsu).
At the meeting, he pointed out that at that time, Wu's nominal ally and fellow rival to Later Liang, Jin, was winning victory after victory over Later Liang, and that Jin's prince Li Cunxu appeared to be posturing to claim the imperial title himself and claim lawful succession from the Tang emperors.
Yan argued that, with that being the case, Wu's political structure was untenable since it, like Jin, had been claiming its desire to reestablish Tang.
Yan instead suggested that Xu Wen advise Yang Longyan to claim imperial title as well and restructure the Wu political structure to cut off connections to Tang.
In the new Wu government, modeled after the Tang imperial government and no longer structured like a circuit headquarters, Yan received the title of Menxia Shilang (門下侍郎) — the deputy head of the examination bureau of government (門下省, Menxia Sheng) (although in effect in command of examination bureau, as since middle Tang times, the position of head of examination bureau, Shizhong (侍中), was usually an honorary title that was rarely actually filled, and in the edicts that Yang Longyan issued after becoming king, no one was made Shizhong).
[12] In 923, Li Cunxu claimed imperial title as the emperor of a new Later Tang (as Emperor Zhuangzong), and was soon set to make a final confrontation with Later Liang after gaining a foothold south of the Yellow River (which had generally defined the boundary between his former Jin state and Later Liang) at Yun Prefecture (鄆州, in modern Tai'an, Shandong).
Yan Keqiu opposed, pointing out that the Wu fleet could be caught in the middle if Later Liang requested aid, so Xu did not do so.
Xu blamed Yan for not launching the fleet north, but Yan believed that the Later Tang emperor's victories were unsustainable given his own personal behavior, stating while smiling:[12] I heard that after the Lord of Tang gained the Central Plains, he became full of arrogance, and was not governing his subordinates appropriately.
We should simply be humble in our words and provide him with good gifts, while protecting our boundaries and our people, to wait for this to happen.Possibly under Yan's advice, Yang Pu subsequently refused to receive edicts (i.e., communiques that would imply that he was a subject of Later Tang's) from Emperor Zhuangzong.
Shortly after Xu Wen's death, Yang Pu, in accordance with his petition, claimed imperial title.