A battery having a cathode and an anode with a three-dimensional porous framework. The anode includes an anode active material lithiated with a lithium source. The lithium particles from the lithium source are alloyed or intercalated with the anode active material during diffusion to form the three-dimensional porous framework. The porous framework provides reduced electrode deterioration due to volume expansion.