A method and device for transferring heat in a thermophotonic heat pump where heat energy is transferred by using light or other electromagnetic radiation from an emitting element to an absorbing element in direction opposite to the direction defined by the second law of thermodynamics. Heat energy is transferred by using the light or other electromagnetic radiation generated in the structure by electroluminescence from the emitting element to the absorbing element. In the absorbing element light or other electromagnetic radiation is absorbed without exploiting the energy of the light or other electromagnetic radiation in a form other than as heat energy.