Jean Lannes had already had a taste of the soldier's life before the outbreak of the revolutionary wars. But his uncontrollable temper had brought this short military experience to an abrupt end, and he had been compelled to return to his work at Lectourne after being wounded in a duel. His employer had greeted his return with the words, "There is not the price of a drink to be made in the trade. Return to the army; you may perhaps become captain." But Jean Lannes did not need such advice to drive him to the path of glory. In June, 1792, the Government of France called for volunteers to resist the coming invasion of the Duke of Brunswick's army. Lannes enlisted in the second battalion of the volunteers of Gers, and was at once elected sub-lieutenant by his fellow-citizens. This promotion he owed partly to his former military experience, partly to his personal magnetism, and partly to his extreme political opinions.

When Spain declared war on France the two battalions of Gers were sent to form part of the Army of the Eastern Pyrenees. There Lannes gained his first practical military experience. Both armies were extremely ill-led, ill-disciplined, and ill-equipped. Consequently there was a great deal of desultory hand-to-hand fighting, in which the young sub-lieutenant distinguished himself by his courage and talent. He enjoyed himself hugely fighting all day and dancing all night, when he could spare the time from his books. When military knowledge was almost entirely absent in the army, promotion came quickly to those who distinguished themselves by courage and zeal. On September 25, 1793, Lannes was promoted lieutenant. A month later, on October 21st, he was made captain of the grenadier company. Two months later, on Christmas Day, at the express desire of his chief, General Davout, he was given command of his battalion, and appointed colonel on the staff and acting adjutant-general. This distinction he gained for his brilliant conduct at Villelongue. Summoned from his bed in hospital to command the advance guard of five hundred men, he moved towards the main redoubt of the Spanish lines, and, refusing to be bluffed by the proposal of an armistice, captured the redoubt by a dashing charge. After the action he once again retired to hospital. His next exploit was the delicate mission entrusted to him by General Dugommier of releasing a great number of French émigrés who had been captured in battle, and who otherwise would have fallen victims to the popular fury. While devoting himself to his military duties he yet found time to fall in love. When in hospital at Perpignan, at the end of 1793, he had met Mademoiselle Méric, the daughter of a wealthy banker of that town; the friendship very soon developed into an ardent passion, and on March 19, 1795, the young couple were united, and the marriage seemed very advantageous for the young soldier of fortune, who was barely twenty-five.

After the treaty of Basle the battalions of Gers were brigaded with the old 53rd (regiment d'Alsace), and formed part of the troops which Schérer took to reinforce the Army of Italy in the summer of 1795. Accordingly, Lannes had the good fortune to take part in the battle of Loano, and once again greatly distinguished himself and was specially mentioned in despatches.

But during the winter of 1795-6 his successful career nearly came to an untimely end, for on the reorganisation of the army, along with many other officers, he was placed on half pay. Fortunately, at the moment he was retiring dejected to France, Bonaparte assumed command of the Army of Italy. The new general felt he could ill spare a capable officer like Lannes, and consequently he retained him provisionally. The young colonel immediately justified his action. At the critical moment of the Austrian counter-attack at Dego, Lannes cleared the village by a brisk bayonet charge. Thereon Bonaparte gave him command of two battalions of grenadiers and one of carbineers, which formed part of his permanent advance guard under General Dallemagne. From this time onward Lannes had found his proper rôle. As nature had intended Marshal Ney for the command of a rear guard, and Murat for the command of cavalry, so she had equipped Lannes with those qualities which are specially required by the commander of an advance guard. Wiry and strong, he never knew what it was to be tired, and, never sparing himself, he never spared his men; his kind and cheery disposition and his personal magnetism carried all before him. His fiery enthusiasm swept aside all difficulties; his inventive genius ever showed him the way to surmount all obstacles. When danger was most pressing Lannes was there, the first to head the charge, the first to rally the discomfited. Never had Fortune a more zealous wooer. At Lodi he was the first man on the bridge. Later, at the head of three hundred men, he re-established order in Lombardy; at one time especially attached to the headquarter staff, at another hurried off to suppress some outbreak in the rear, at another repelling a determined sortie from Mantua, more and more, day by day, he made himself indispensable to his young chief. At the battle of Bassano, of the five flags wrested from the enemy Lannes captured two with his own hands. Wounded slightly at Bassano and more seriously at Governolo, he yet managed to creep out of hospital in time to take his place beside Bonaparte at Arcola. Early in the battle he received two flesh wounds, and had to retire to have them dressed. Scarcely were they bandaged when the news arrived that Augereau's division had received a severe check. Oblivious of his wounds, he leapt on his horse and arrived at the head of his columns in time to see Augereau and Bonaparte, flag in hand, vainly attempting to rally their soldiers, only to be swept off the embankment into the marsh. But Lannes headed his grenadiers, and charging home on the Austrians, swept them back to the bridge-head, receiving in the charge yet another wound.

During the early months of 1797 he commanded a column at Bologna, and was present at the capitulation of Mantua. Thereafter he commanded the advance guard of Victor's army which invaded the Papal States. In front of Ancona he met with a characteristic adventure. Making a reconnaissance with two or three officers and half a dozen troopers, he suddenly found himself in the presence of three hundred of the enemy's cavalry. Their commander at once ordered his men to draw their swords preparatory to a charge. Whereon Lannes rode up to him and told him to order his men to return their swords, dismount, and lead their horses back to their headquarters. The officer obeyed. By sheer force of character Lannes thus dominated the situation and saved the lives of himself and his escort. After the preliminaries of peace at Leoben, Bonaparte employed him on several confidential missions, in which his impetuosity led him at times into difficulties, and the commander-in-chief was forced to write to the French Minister at Genoa, "I have heard the reply that Lannes made to you. He is hot-headed, but a good fellow, and brave. I must write to him to tell him to be more civil to a minister of the Republic."

Africa has often proved the grave of great military reputations. Napoleon himself only escaped the usual doom by deserting his army and suddenly appearing as a deus ex machina in the stormy field of politics at Paris. But though so fatal to those in supreme command, Africa has sometimes been the school from which the young officers have returned with enhanced reputations. It was from the companions who had stood the test of the fiery trial in Egypt and Syria that Bonaparte later selected his most trusted Marshals.

On May 19, 1798, Lannes sailed for Egypt in the Orient as an unattached general of brigade on the headquarter staff. For his successful action at the head of one of the assaulting columns in Malta he was appointed to the command of a brigade in Kléber's division. He took part in the capture of Alexandria, the march on Cairo, and the battles of Chebrass and the Pyramids; but it was not so much his success in these engagements which enhanced his worth in Bonaparte's eyes, as the fact that Lannes alone of all the general officers in Egypt did not share in the grumbling and depression which threatened to cripple the army after its arrival at Cairo. Soldiers and officers alike had but one desire—to return home. Lannes secretly informed Bonaparte of the plans of those who led the discontent, and, in the words of Murat, "sold the cocoanut." Thus he gained the future Emperor as his life-long friend and Murat as his life-long enemy. When in February, 1799, Bonaparte started for Syria, he took with him Lannes in command of Menou's division.

When Bonaparte found that his military reputation was likely to suffer by a more prolonged stay in Egypt, and above all that France was now ready to accept the rule of a dictator, he deserted his army in Egypt, leaving Kléber, whom he hated, in command; he took with him his most trustworthy officers, Lannes, Murat, Marmont, Andréossy, and Berthier, ordering Desaix to follow. The return to France, so longed for by most, was less agreeable to Lannes: while in hospital after the battle of Aboukir he had heard that his wife had given birth to a son whose father he could not be. Consequently one of his first acts on his return was to divorce her. But Bonaparte gave him little time to bewail his misfortune, for he relied on him, with Berthier, Murat, and Marmont, to debauch the army and bring it over to his side. Berthier's business was to win over the general staff, Murat the cavalry, Marmont the artillery, and Lannes the infantry. Shortly after the coup d'état General Lannes was appointed commandant and inspector of the Consular Guard in preference to Murat. But this was a hollow victory over his rival, for when, after the Marengo campaign, these life-long enemies met in open rivalry for the hand of Caroline Bonaparte, the First Consul's sister, Murat, aided by Josephine, became the accepted suitor, and Lannes had to submit to see his hated rival in quick succession the brother-in-law of Napoleon, a Prince of the Holy Roman Empire, the crowned King of Naples, and, most bitter of all, the confidential friend of his idol.

It was in the Marengo campaign that the general had his first opportunity of distinguishing himself as an independent commander, and winning the renown which the victory of Montebello inseparably connects with his name. When Bonaparte made his famous march into Italy with the Army of the Reserve, he appointed Lannes to command the advance guard. The whole success of the operations depended on the rapidity with which they were carried out, for the First Consul, in his endeavour to get astride the Austrian line of communication, was exposing his flank to the enemy, and the French army, if beaten, had no other line of retreat save the terrible defiles of the Alps. Accordingly, Napoleon's selection of Lannes to command the advance guard is the highest possible testimony to his military ability. The battle of Montebello was Lannes's first independent engagement. In it he showed his genius for war. If he had allowed the Austrians to reoccupy Stradella he would have ruined the whole of Napoleon's scheme of operations, but, though his force was only a third of the enemy's, he remembered the advantage that comes to the assailant; instead of waiting in an entrenched position, he attacked, and by his indomitable courage and tenacity, and his tactical ability, he kept the enemy pinned to his entrenchments until the arrival of fresh troops under Victor enabled him to pulverise his foe. The battle was one of the finest of the campaign. "The bones," said Lannes, "cracked in my division like glass in a hailstorm."