Black phosphorus has been recently rediscovered as a new and interesting two-dimensional material due to its unique electronic and optical properties. Here, we study the linear and nonlinear optical properties of black phosphorus thin films, indicating that both linear and nonlinear optical properties are anisotropic and can be tuned by the film thickness. Then we employ the nonlinear optical property of black phosphorus for ultrafast (pulse duration down to ~786 fs in mode-locking) and large-energy (pulse energy up to >18 nJ in Q-switching) pulse generation in fiber lasers at the near-infrared telecommunication band ~1.5 {mu}m. Our results underscore relatively large optical nonlinearity in black phosphorus and its prospective for ultrafast pulse generation, paving the way to black phosphorus based nonlinear and ultrafast photonics applications (e.g., ultrafast all-optical switches/modulators, frequency converters etc.).