A metal paste that includes a metal component and a flux. The metal component includes a first metal powder and a second metal powder. The first metal powder is Sn. The second metal powder is a CuNi alloy. The metal paste is heated for a time t1 to a temperature T1 where the first metal powder is melted. Next, the metal paste is heated for a time t2 longer than the time t1 at a temperature T2 lower than the temperature T1 to produce an intermetallic compound from the first metal Sn and the second metal CuNi alloy.