Classification of brain tumors is of great importance in medical applications that benefit from computer-aided diagnosis. Misdiagnosis of brain tumor type will both prevent the patient from responding effectively to the applied treatment and decrease the patient's chances of survival. In this study, we propose a solution for classifying brain tumors in MR images using transfer learning networks. The most common brain tumors are detected with VGG16, VGG19, ResNet50 and DenseNet21 networks using transfer learning. Deep transfer learning networks are trained and tested using four different optimization algorithms (Adadelta, ADAM, RMSprop and SGD) on the accessible Figshare dataset containing 3064 T1-weighted MR images from 233 patients with three common brain tumor types: glioma (1426 images), meningioma (708 images) and pituitary (930 images). The area under the curve (AUC) and accuracy metrics were used as performance measures. The proposed transfer learning methods have a level of success that can be compared with studies in the literature; the highest classification performance is 99.02% with ResNet50 using Adadelta. The classification result proved that the most common brain tumors can be classified with very high performance. Thus, the transfer learning model is promising in medicine and can help doctors make quick and accurate decisions.