At Marengo Lannes had to reverse his usual rôle and fight a rear-guard action, for during the early part of the engagement the French were outnumbered by thirty thousand men against eighteen thousand, and yet the general was able to report: "I carried out my retirement by successive echelons under a devastating fire of artillery, amid successive charges of cavalry. I had not a single gun to cover my retreat, and yet it was carried out in perfect order." The soldier who in the hour of success was full of impetuosity and élan, in the hour of retreat was able to inspire his troops with stubborn courage and unfailing self-confidence, which did much to secure the victory.

After Marengo came a period of peace. Lannes, as commander of the Consular Guard, had his headquarters in Paris, and, owing to his official position, was constantly in touch with Bonaparte. But, necessary as he was in war time, his companionship during peace was not altogether congenial to the First Consul, and as time went on it became almost distasteful. Although happily married to Mademoiselle Louise Antoinette Guéheneuc, the daughter of a senator, he felt himself aggrieved that Bonaparte had not supported his suit with Caroline, and was extremely jealous of many of the First Consul's friends. The constant bickering between Lannes and Murat never ceased. Moreover Lannes, as an out-and-out republican, treated the First Consul in a frank spirit of camaraderie, relying on his services at Arcola and Montebello. This Bonaparte not unnaturally resented. The increased ceremonial of the court and the prospect of the Concordat were abhorrent to the stern republicans, but necessary to establish the divinity which should at least seem to surround a throne. Relations became so strained that Bonaparte was soon glad to seize on any excuse to dismiss Lannes from his post. Murat and his tool Bessières provided him with a plausible reason. Lannes, by nature happy-go-lucky and no financier, wishing no doubt to please the First Consul, spent his money freely in lavish entertainment at his Paris house, and equipped the guard in most gorgeous uniforms. To meet these expenses he overdrew his account with the military authorities by more than three hundred thousand francs. Murat, hearing of this from Bessières, brought it to the First Consul's notice. Bonaparte at once summoned Lannes, rated him soundly, and commanded him immediately to refund the money. Murat was delighted; he thought that his enemy was certain to be disgraced. In his difficulty Lannes turned to his old friend and former chief, Augereau, who at once lent him the money and refused to take any security. But although he was thus able to refund the money, Bonaparte dismissed him from the command of the Guard. Still, remembering his war service and thinking that he might be useful again later, he did not disgrace him utterly, but at the end of 1801 sent him as ambassador to Portugal.

Lannes's diplomatic career was at first not very successful. English influence was all-powerful at Lisbon and the new envoy had not the talent to counteract it. In the autumn of 1802, thinking himself slighted by the Portuguese authorities, without consulting Talleyrand, he suddenly withdrew from Lisbon and returned to France. But at Orleans he received an angry message from Bonaparte forbidding him to return to Paris. The First Consul meanwhile addressed peremptory messages to the court of Lisbon about the supposed insult offered to his ambassador. Thereon the Portuguese Foreign Minister apologised and Lannes returned. Angry as Bonaparte was at the moment, he confessed later that Lannes' soldierly impetuosity had served the cause of France better than the skilfulness of a consummate diplomat. For from this time onwards French influence began to increase at Lisbon, Lannes was courted by the minister, and the Prince Regent himself stood godfather to his son. The story goes that after the ceremony the Prince Regent took the ambassador into a salon of the palace where the diamonds from Brazil were stored, and then gave him a handful, saying, "That is for my godson," then a second handful for the mother, and a third for himself. Whatever the truth of the story, the fact remains that Lannes returned to France a rich man, able not only to repay his loan to Augereau but to indulge in fresh extravagance.

From Lisbon the ambassador was summoned to attend the coronation of the Emperor and to take his place among the Marshals. But he was not yet received back into full favour by the Emperor, and had to return to his embassy at Lisbon. It was not till March 22, 1805, that he was recalled to France to command the right wing of the Army of the Ocean, which, when war broke out between Austria and France, became the Grand Army. The fifth corps under Lannes reached the Rhine at Kehl on September 25th. Napoleon's scheme of operations was, by making vigorous demonstrations in the direction of the Black Forest, to persuade the Austrians that he was advancing in force in that direction, while all the time his wings were sweeping round the Austrian rear and cutting their line of communication on the Danube, in the direction of Ratisbon. The task of deceiving the Austrians was performed to perfection by Murat with the reserve cavalry and Lannes's corps. Immediately after Mack's surrender at Ulm, the Emperor detached Lannes and Murat in pursuit of the Archduke Ferdinand, who had successfully broken through the ring of French troops. Lannes's infantry tramped sturdily behind Murat's cavalry, and fighting proceeded day and night. The soldiers marched thirteen, fourteen, and fifteen hours a day, and captured in five days fifteen thousand men with eleven colours, one hundred and twenty-eight guns, and six hundred limbers and provision wagons.

During the rapid advance down the Danube on Vienna, the fifth corps continued in close support of Murat's cavalry. Vienna capitulated and the Marshals pressed on to seize the bridge before the city. The defence of the bridge had been entrusted to General Auersperg, with seven thousand men. The bridge was commanded by a battery of artillery, and the engineers were preparing to blow it up when Murat, Lannes, and Bertrand arrived. The three general officers quietly walked down to the bridge and shouted out to the Austrian picquets that an armistice had been arranged. Thereon the commander of the picquet proceeded to withdraw his men and sent word to Auersperg. Meanwhile the three officers strolled unconcernedly across, while a considerable way behind them a strong body of Lannes's infantry followed. When the French generals reached the Austrian end they found a sergeant of engineers actually proceeding to fire the fuse. Lannes caught him by the arm and snatched the match from his hand, telling him that it was a crime to blow up the bridge, and that he would be disgraced if he did such a thing. Then the two Marshals ran up to the officers commanding the artillery, who, growing restive at the continual advance of the French infantry, were preparing to open fire. Meanwhile Auersperg himself arrived, and the Marshals told him the same tale, affirming that the French were to occupy the bridge-head. Uncertain, like his subordinates, and but half convinced, he allowed himself to be bluffed, and thus Napoleon secured without dispute the crossing of the Danube. The boldness and audacity of the scheme so successfully carried out by Murat and Lannes, difficult as it is to condone from a moral point of view, brings out with great clearness the audacity, sangfroid, and resourcefulness of both these Marshals.

The successful crossing of the Danube was soon followed by the decisive battle of Austerlitz. The battle was brought on by Napoleon impressing the Allies with the idea that it was possible to slip past the French left flank and surround him, much as he had surrounded Mack at Ulm. For this purpose the right under Davout was drawn back and concealed by skilful use of the ground. The centre under Soult and the left under Lannes were to hold their ground until the Russian left was absolutely compromised, when Soult was to push forward, and, seizing the commanding hill of Pratzen, to cut the Russian force in two, while Lannes and Murat were to fall with all their weight on the isolated Russian right. For once Murat and Lannes laid aside their jealousy and worked hand in hand, and the success of the French left was due to the perfect combination of infantry and cavalry. Of the Russian right, seven thousand five hundred were made prisoners, and two colours and twenty-seven pieces of artillery were captured. But hardly had the battle ceased when bickerings broke out again, and Lannes, thinking Napoleon did not appreciate him, sent in his resignation, which the Emperor, much to his surprise, accepted.

The Marshal spent the greater part of the year 1806 in retirement at his native town of Lectourne, where he was joyfully received by his erstwhile neighbours and friends. He was always popular with his fellow-citizens, not only because of his republican ideas and his unaffected simplicity, but because he never forgot those who at any time had befriended him—a man who had once lent him a thousand francs was presented with a beautiful house and garden; the old soldier who had carried him out of the trenches at St. Jean d'Acre was established as a local postmaster, and received a small property and an annuity, and the Marshal never passed the house without going in, taking a meal with him, and making presents to the wife and children. On one occasion Lannes was attending a big official reception at Auch. On his way, he passed a peasant whom he recognised as one of the playfellows of his boyhood; strongly moved, the Marshal, when he arrived at the prefecture, asked the prefect if he might invite one of his friends to the luncheon. The prefect was charmed, but much surprised when an aide-de-camp returned with the peasant, whom Lannes embraced, placed by his side, and soon set at ease.

But war once again caused the Emperor to summon his fiery lieutenant. Lannes took command of the fifth corps on October 5, 1806, and five days later had the satisfaction of beating a strong Prussian force at Saalfeld. From Saalfeld the Marshal pushed on towards Jena, near which town, early on October 13th, his scouts came in contact with a large Prussian force under Hohenlohe. His small force was in considerable danger, but Napoleon at once hurried up all possible reinforcements. The Prussians held an apparently impregnable position on the Landgrafenberg, a precipitous hill which commanded the town. But during the night a local pastor pointed out to the French a track, which led up to the summit, which the Prussians had neglected to occupy. Working all night, the French sappers made a road up which guns could be hauled by hand, and on the morning of the 14th the corps of Lannes, Augereau, and the Guard were safely drawn up on the plateau of the Landgrafenberg, while Ney and Soult continued the line to the north. A heavy mist overhung the field of battle, and Hohenlohe was confident that he was only opposed by the fifth corps, and his surprise was immense when the fog lifted and he found himself confronted by the French army. The battle commenced by Lannes seizing the village of Vierzehn Heiligen. While the Prussians were fully occupied in attempting to hold this village, Napoleon threw his flanks round them, and the battle ended in the annihilation of Hohenlohe's army. In the evening Napoleon learned that on the same day Davout had completely defeated the main Prussian army at Auerstädt. Thereon he sent forward his various corps to seize all the important fortresses of Prussia, and detailed Lannes to support Murat in pursuit of the Prussian troops under Hohenlohe and Blücher, which retreated in the direction of the Oder. If the battle of Jena had been followed by peace, as had happened after Austerlitz in the previous year, it is more than probable that once again Lannes would have thrown up his command, for when the bulletin appeared, the part that his corps had taken was almost entirely neglected. The Marshal's letter to his wife showed that he was vexed beyond words with his treatment by Napoleon, and he started out in the worst of tempers to support Murat. But he was too keen a soldier to let his personal grievances interfere with his active work, and, although he gave vent to his spleen in the usual recriminations, he performed his work to admiration. So hard did he push his infantry, marching sixty miles in forty-eight hours, that he was never more than five miles behind the light cavalry, and it was owing to his effective support that, on October 28th, Murat was able to surround Hohenlohe and force him to surrender at Prinzlow. But, in spite of this, Murat in his despatch never mentioned the name of Lannes. It took all Napoleon's tact to smooth the Marshal's ruffled temper, and it was only the prospect of further action which ultimately prevented him from throwing up his command in high dudgeon.

By the beginning of November the theatre of war was virtually transferred from Prussia to Poland. As after Ulm, so after Jena, the Russians appeared on the scene too late to give effective aid to their allies, but in sufficient time to prevent the war from ending. Napoleon, who always had an intense esteem for the Marshal's common sense and military ability, asked him at this time to furnish a confidential report on the possibilities of Poland as a theatre of war, and the Marshal, with his keen insight into character, replied, "I am convinced that if you attempt to make the Poles rise on our behalf, within a fortnight they will be more against us than for us."

The French troops crossed the Vistula at Warsaw, and encountered "the fifth element, mud." Led by Murat, unable to make headway in mud up to their knees, baffled by the Fabian tactics of the Russians, and lacking the mighty brain of their Emperor, the Marshals fought without co-operation, each for his own glory. Lannes was as bad as the rest, showing in his refusal to give due praise to his brother generals for their help at Pultusk the same petty spirit of which he had complained in Murat. During the long winter weeks spent in cantonments along the Vistula, the Marshal was ill with fever, in hospital at Warsaw, and was not able to return to the head of his corps in time for the bloody battle of Eylau. During May he commanded the covering force at the siege of Dantzig, and was summoned thence to take part in the last phase of the campaign. The Russian General, Bennigsen, allowed himself to be outgeneralled by Napoleon, and the French were soon nearer Königsberg than the Russians. Bennigsen made desperate efforts to retrieve his mistake, and on June 13th actually managed to throw himself across the Alle at Friedland, just at the moment that Lannes arrived on the scene. The Marshal at once saw his opportunity. The Russians were drawn up with the Alle at their backs, so that retreat was impossible, and only victory could save them. The Marshal's design, therefore, was to hold the enemy till the main French army arrived. Bennigsen made the most determined efforts to throw him off, attempting to crush him by superior weight of horsemen and artillery. But the Marshal held on to him grimly, and by magnificent handling of Oudinot's grenadiers, the Saxon horse, and Grouchy's dragoons, he maintained his position in spite of all the Russian efforts during the night of June 13th. On the morning of the 14th, with ten thousand troops opposed to forty thousand, he fought for four hours without giving ground, skilfully availing himself of every bit of wood and cover, till at last reinforcements arrived. When the main French columns were deployed, Lannes, with the remnant of his indomitable corps, had a brief period of rest. But during the last phase of the battle the enemy made a desperate effort to break out of the trap through his shattered corps, and once again the Marshal led his troops with invincible élan, and drove the Russians right into the death-trap of Friedland.