Bond Potential Energy Lowering
Two different factors play a role when considering a reaction. The energy of the bonds etc. (enthalpy) and the entropy. Together, these two components make up what is called the 'Gibbs Free Energy'. (Wikipedia)

The change in Gibbs free energy ($\Delta{}G$) of a system must be $&lt; 0$ for a reaction to be spontaneous. From this it is possible to see that a reaction where the entropy increases drastically, but the enthalpy increases. In this case a reaction can be endothermic. 

A case of terminology: The 'more correct' term (my teacher always said) is exergonic or endergonic. What this means is that the reaction has a $\Delta{}G &lt; 0$ or $\Delta{}G &gt; 0$ respectively.

As @Cohorent mentioned before, it is also possible to have a system that is larger than just the chemical reaction (adding a battery for example). Meaning that the reaction is maybe endergonic, but a different energy source is used to drive the reaction. Note then, that the $\Delta{}G$ for the entire system is still below zero.