In music, a counter-melody (often countermelody) is a sequence of notes, perceived as a melody, written to be played simultaneously with a more prominent lead melody. In other words, it is a secondary melody played in counterpoint with the primary melody. A counter-melody performs a subordinate role, and it is typically heard in a texture consisting of a melody plus accompaniment.
The more formal term countersubject applies to a secondary or subordinate melodic idea in a fugue. A countermelody differs from a harmony part sung by a backup singer in that whereas the harmony part typically lacks its own independent musical line, a countermelody is a distinct melodic line.