State estimation and tracking often require optimal or unbiased estimators. In this paper, we propose the batch optimal finite impulse response (OFIR) filter for time-variant systems where both system and measurement noises are required to be filtered out. To avoid inverse computation of matrices with large dimensions, iterative version is further developed. It shows that the OFIR filter is as the same form of Kalman filter (KF) with special initial conditions on the estimation horizon. A simulation example is given to demonstrate some important properties of the OFIR filter, compared with unbiased FIR (UFIR) filter and KF.