New pyrimidine or pyridine based compounds, compositions and methods of inhibiting the activity of glycogen synthase kinase (GSK3) in vitro and of treatment of GSK3 mediated disorders in vivo are provided. The methods, compounds and compositions of the invention may be employed alone, or in combination with other pharmacologically active agents in the treatment of disorders mediated by GSK3 activity, such as diabetes, Alzheimer's disease and other neurodegenerative disorders, obesity, atherosclerotic cardiovascular disease, essential hypertension, polycystic ovary syndrome, syndrome X, ischemia, traumatic brain injury, bipolar disorder, immunodeficiency or cancer.