Biomass-based fuels have attracted worldwide interest due to their plentiful supply and their environmentally friendly characteristics. In many cases they are still considered waste but for most industries in Sweden, biomass has changed from being simply a disposal problem to become an important part of the energy supply, thanks to the long-term efforts made by the government, researchers and industry, where energy policies have played an important role. However, the amount of power that could be generated from biomass resources is much greater than that which is currently used. To effectively capture this resource requires a new generation of biomass power plants and their effective integration into already existing industrial processes. The implementation of an integrated polygeneration scheme requires the simultaneous consideration of technical, economic and environmental factors to find optimum solutions. With this in mind, a unified modeling approach that takes into account thermodynamic as well as economic and environmental aspects was used. The analysis was done using ASPEN Utilities and the MATLAB optimization toolbox. A specific case of a sawmill in Sweden, with an annual capacity of 130'000 m3 of sawn wood, has been analyzed and different options for generating electricity and process heat (for the sawmill and for a district heating network) as well as densified biofuels was analyzed. Optimization was then applied for different configurations and operational parameters. The results show that the sawmill has the capability to not only supply its own energy needs, but also to export from 0.4 to 1MW of electricity to the grid, contribute 5 to 6 MWth of district heating and 20 000 ton/y of biomass pellets. The production of pellets helps to maintain the electricity production throughout the year when the district heating demand is lower. However, the levelized electricity cost is higher than the usual electricity price in the Nordic electricity market and may have difficulty to competing with low-cost electricity sources, such as nuclear energy and hydropower. In spite of this, polygeneration remains attractive for covering the energy demands of the sawmill and pelletization plant.