An efficient one-pot synthesis of fused pyridine derivatives (including pyrazolo[3,4-b]pyridine and pyrido[2,3-d]pyrimidine) by three-component reaction of aldehyde, acyl acetonitrile, and electron-rich amino heterocycles (including aminopyrazole and aminouracils) in ionic liquid is reported. This new protocol has the advantages of environmental friendliness, higher yields, shorter reaction times, and convenient operation.