The ability of neurons to differentially respond to specific temporal and spatial input patterns underlies information storage in neural circuits. One means of achieving spatial specificity is to restrict signaling molecules to particular subcellular compartments using anchoring molecules such as A-Kinase Anchoring Proteins (AKAPs). Disruption of protein kinase A (PKA) anchoring to AKAPs impairs a PKA-dependent form of long term potentiation (LTP) in the hippocampus. To investigate the role of localized PKA signaling in LTP, we developed a stochastic reaction-diffusion model of the signaling pathways leading to PKA activation in CA1 pyramidal neurons. Simulations investigated whether the role of anchoring is to locate kinases near molecules that activate them, or near their target molecules. The results show that anchoring PKA with adenylyl cyclase (which produces cAMP that activates PKA) produces significantly greater PKA activity, and phosphorylation of both inhibitor-1 and AMPA receptor GluR1 subunit on S845, than when PKA is anchored apart from adenylyl cyclase. The spatial microdomain of cAMP was smaller than that of PKA suggesting that anchoring PKA near its source of cAMP is critical because inactivation by phosphodiesterase limits diffusion of cAMP. The prediction that the role of anchoring is to colocalize PKA near adenylyl cyclase was confirmed by experimentally rescuing the deficit in LTP produced by disruption of PKA anchoring using phosphodiesterase inhibitors. Additional experiments confirm the model prediction that disruption of anchoring impairs S845 phosphorylation produced by forskolin-induced synaptic potentiation. Collectively, these results show that locating PKA near adenylyl cyclase is a critical function of anchoring.