Non-linear attenuation of the Arterial Input Function (AIF) is a major problem in first-pass MR perfusion imaging due to the high concentration of the contrast agent in the blood pool. This paper presents a technique to reconstruct the true AIF using signal intensities in the myocardium and the attenuated AIF based on a Hierarchical Bayesian Model (HBM). With the proposed method, both the AIF and the response function are modeled as smoothed functions by using Bayesian penalty splines (P-Splines). The derived AIF is then used to estimate the impulse response of the myocardium based on deconvolution analysis. The proposed technique is validated both with simulated data using the MMID4 model and ten in vivo data sets for estimating myocardial perfusion reserve rates. The results demonstrate the ability of the proposed technique in accurately reconstructing the desired AIF for myocardial perfusion quantification. The method does not involve any MRI pulse sequence modification, and thus is expected to have wider clinical impact.