This paper presents a set of algorithms for fault diagnosis and fault tolerant control strategy for affine nonlinear systems subjected to an unknown time-varying fault vector. First, the design of fault diagnosis filter is performed using nonlinear observer techniques, where the system is decoupled through a nonlinear transformation and an observer is used to generate the required residual signal. By introducing an extra input to the observer, a direct estimation of the time-varying fault is obtained when the residual is controlled, by this extra input, to zero. The stability analysis of this observer is proved and some relevant sufficient conditions are obtained. Using the estimated fault vector, a fault tolerant controller is established which guarantees the stability of the closed loop system. The proposed algorithm is applied to a combined pH and consistency control system of a pilot paper machine, where simulations are performed to show the effectiveness of the proposed approach.