Lockhart's next appointment was to the 66-gun in April 1747. "Devonshire" was the flagship of Rear-Admiral Peter Warren, under whom Lockhart saw action at the First Battle of Cape Finisterre on 3 May 1747. He was then appointed to his first command, that of the fireship , in which he saw action with Sir Edward Hawke's fleet at the Second Battle of Cape Finisterre on 16 October 1747. One of the captains in the battle, Thomas Fox of the 64-gun , was later relieved of his command after controversy over his actions in the engagement, and Lockhart was given temporary command of "Kent" in his place. During 1748 Lockhart was first lieutenant of the Portsmouth guardship , and for the next few years was on half pay in Scotland. In January 1755 he was appointed first lieutenant of the 90-gun with Captain Charles Saunders, and on 22 April 1755 he was promoted to command the 8-gun sloop , attached during the year to the western squadron cruising under the command of Sir Edward Hawke or Vice-Admiral John Byng.