Victory over the tie will see the reds join the group stage of the Europa League, which comes with it €1M UEFA prize money (not including TV money) with further enhancements depending on results in the group and qualification.
Hearts won their 8th Scottish FA Cup last season - beating Hibernian 5-1 in the final, which means that they entered the competition at this stage.
The first leg will be played at Tynecastle, with the return leg at Anfield a week later.
The reds have not played Hearts in competitive football before.
Full draw
FC Anzhi Makhachkala (RUS) v AZ Alkmaar (NED)
APOEL FC (CYP) v Neftçi PFK (AZE)
Atromitos FC (GRE) v Newcastle United FC (ENG)
Tromsø IL (NOR) v FK Partizan (SRB)
FC Vaslui (ROU) v FC Internazionale Milano (ITA)
Heart of Midlothian FC (SCO) v Liverpool FC (ENG)
Athletic Club (ESP) v HJK Helsinki (FIN)
CS Marítimo (POR) v *FC Dila Gori (GEO) or Anorthosis Famagusta (CYP)
Molde FK (NOR) v sc Heerenveen (NED)
Debreceni VSC (HUN) v Club Brugge KV (BEL)
FC Sheriff (MDA) v Olympique de Marseille (FRA)
Trabzonspor AŞ (TUR) v Videoton FC (HUN)
FC Midtjylland (DEN) v BSC Young Boys (SUI)
WKS Śląsk Wrocław (POL) v Hannover 96 (GER)
FC Dinamo Bucureşti (ROU) v FC Metalist Kharkiv (UKR)
AC Horsens (DEN) v Sporting Clube de Portugal (POR)
Hapoel Tel-Aviv FC (ISR) v F91 Dudelange (LUX)
Feyenoord (NED) v AC Sparta Praha (CZE)
Motherwell FC (SCO) v Levante UD (ESP)
FK Crvena zvezda (SRB) v FC Girondins de Bordeaux (FRA)
KSC Lokeren OV (BEL) v FC Viktoria Plzeň (CZE)
S.S. Lazio (ITA) v ND Mura 05 (SVN)
AIK Solna (SWE) v PFC CSKA Moskva (RUS)
Legia Warszawa (POL) v Rosenborg BK (NOR)
Bursaspor (TUR) v FC Twente (NED)
FC Steaua Bucureşti (ROU) v FK Ekranas (LTU)
FC Slovan Liberec (CZE) v FC Dnipro Dnipropetrovsk (UKR)
VfB Stuttgart (GER) v FC Dinamo Moskva (RUS)
PAOK FC (GRE) v SK Rapid Wien (AUT)
FC Luzern (SUI) v KRC Genk (BEL)
FK Zeta (MNE) v PSV Eindhoven (NED)
Games will be played the midweek of 23rd and 30th August 2012.