A three-dimensional (3D) lattice Boltzmann flux solver (LBFS) is presented in this paper for the simulation of both isothermal and thermal flows. The present solver combines the advantages of conventional Navier-Stokes (N-S) solvers and lattice Boltzmann equation (LBE) solvers. It applies the finite volume method (FVM) to solve the N-S equations. Different from the conventional N-S solvers, its viscous and inviscid fluxes at the cell interface are evaluated simultaneously by local reconstruction of LBE solution. As compared to the conventional LBE solvers, which apply the lattice Boltzmann method (LBM) globally in the whole computational domain, it only applies LBM locally at each cell interface, and flow variables at cell centers are given from the solution of N-S equations. Since LBM is only applied locally in the 3D LBFS, the drawbacks of the conventional LBM, such as limitation to uniform mesh, tie-up of mesh spacing and time step, tedious implementation of boundary conditions, are completely removed. The accuracy, efficiency and stability of the proposed solver are examined in detail by simulating plane Poiseuille flow, lid-driven cavity flow and natural convection. Numerical results show that the LBFS has a second order of accuracy in space. The efficiency of the LBFS is lower than LBM on the same grids. However, the LBFS needs very less non-uniform grids to get grid-independence results and its efficiency can be greatly improved and even much higher than LBM. In addition, the LBFS is more stable and robust.