A Kalman filter package has been developed for reconstructing muon ($mu^pm$) tracks (coming from the neutrino interactions) in ICAL detector. Here, we describe the algorithm of muon track fitting, with emphasis on the error propagation of the elements of Kalman state vector along the muon trajectory through dense materials and inhomogeneous magnetic field. The higher order correction terms are included for reconstructing muon tracks at large zenith angle $theta$ (measured from the perpendicular to the detector planes). The performances of this algorithm and its limitations are discussed.